On this page

Signed URLs

Give time-limited access to files in private buckets, and let clients upload without a policy.

JavaScript
// Private buckets: create a temporary link (expires in 60 seconds)
const { data: signed } = await stitchdb.storage.from('invoices').createSignedUrl('2026/10.pdf', 60)

The second argument is the expiry in seconds. Anyone with the link can download the file until it expires. Pass { download: true } to make the browser save the file.

#Several files at once

JavaScript
const { data } = await stitchdb.storage.from('invoices').createSignedUrls(['2026/09.pdf', '2026/10.pdf'], 3600)

#Signed upload URLs

A server with the service_role key can create a one-time upload URL, so a client can upload one file to a fixed path:

JavaScript
// server
const { data } = await admin.storage.from('uploads').createSignedUploadUrl('user-123/report.pdf')
// client
await stitchdb.storage.from('uploads').uploadToSignedUrl('user-123/report.pdf', data.token, file)

In Studio, Signed URL on a file creates a link valid for 1 hour, 24 hours, 7 days or a custom time from 60 seconds to one year.