Skip to main content

Installation

Initialize Restash

lib/restash.ts
The Restash class accepts a single parameter, which is your private API key. You can create an API key here.

Upload a file

The upload method accepts the following parameters:
File | Blob
required
The file or blob to upload.
UploadOptions object
An object with the following optional properties:
A successful upload will respond with the following:
UploadFileResponseSuccess object
The information about the uploaded file.

Retrieve a file

The retrieve method accepts the following parameters:
RetrieveFileOptions object
An object with the following properties, either id or key is required:
A successful retrieval will respond with the following:
RetrieveFileResponseSuccess object
The information about the retrieved file.

Delete a file

The delete method accepts the following parameters:
DeleteFileOptions object
An object with the following properties, either id or key is required:
A successful deletion will respond with the following:
DeleteFileResponseSuccess object
A confirmation of the deletion.

Additional resources

NPM package

Download and install the Restash Node.js SDK from NPM

Source code

View the complete source code for the Restash Node.js SDK