Skip to main content
Easily upload files directly from the browser with Restash. This guide shows you how to set up client-side uploads using our lightweight SDK.

Prerequisites

To follow this guide, you will need to:

Install and initialize the Restash uploader

1

Install

Install the Restash JS client SDK using your preferred package manager. Restash works with all Javascript front end frameworks.
2

Initialize Restash uploader

Initialize the uploader with your public API key
lib/restash.ts
3

Use the uploader

You can now import the uploader and use it to upload files.

Uploading your first file

In this example, we will upload a file in Next.js
my-form.tsx

Signed uploads

Enabling signed uploads for your team ensures that only your server can authorize uploads by requiring a secure signature for each request. This prevents abuse and gives you full control over who can upload.

Implementing signed uploads

1

Require signed uploads for your team

Navigate to your team settings page and enforce signatures.
2

Create an endpoint to generate signatures

Generate signatures using the generateSig function with your secret key.
/api/restash/signature/route.ts
3

Pass your endpoint the uploader

Pass your route to createRestashUploader
lib/restash.ts

Next steps

You’re now ready to start uploading files with Restash! Check out the full client SDK and explore advanced features like custom paths, upload progress tracking, and more.