Client uploads
Learn how to upload files directly from the browser to Restash.
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
Install
Install the Restash client SDK using your preferred package manager. Restash works with all Javascript front end frameworks.
Initialize Restash uploader
Initialize the uploader with your public API key
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
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
Require signed uploads for your team
Navigate to your team settings page and enforce signatures.
Create an endpoint to generate signatures
Generate signatures using the generateSig
function with your secret key.
Pass your endpoint the uploader
Pass your route to createRestashUploader
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.