Access, links and delivery
Who can upload, download and delete: bucket rules and their fields, public and signed URLs and how long links last, caching and bandwidth, what image transformations do today, and files in HIPAA projects.
#Create and manage buckets
Creating, changing, emptying and deleting a bucket is project administration: app users need the project's admin app role; console members and server keys are decided by your policies. supabase's names work in every SDK — fileSizeLimit takes bytes or a size like '5MB'; allowedMimeTypes takes patterns like image/*. emptyBucket deletes every file and keeps the bucket (1,000 files per round; the SDKs repeat until it is empty).
const { error } = await sovaria.storage.createBucket('avatars', { public: true, fileSizeLimit: '2MB', allowedMimeTypes: ['image/*'] })
const { data: buckets } = await sovaria.storage.listBuckets() // { data, error } with results: 'supabase'
await sovaria.storage.updateBucket('avatars', { fileSizeLimit: '5MB' })
await sovaria.storage.emptyBucket('scratch')
await sovaria.storage.deleteBucket('scratch')#Bucket rules
Each bucket's Policies tab holds its rules (access policies named [bucket:<name>] …). Presets cover the usual cases; you can write your own with these fields (Policy language (SPL)):
| Field | Value |
|---|---|
ctx.action | READ (download), LIST, WRITE (upload, replace, move in), DELETE |
ctx.resource.name | The bucket |
ctx.storage.path | The file's path in the bucket |
ctx.storage.folder | The path's first folder |
ctx.storage.in_own_folder | True when that folder is the caller's user id |
ctx.org.*, ctx.app_metadata.* | The caller's active app organization and admin-set metadata: one folder per tenant with ctx.storage.folder == ctx.org.id |
ctx.actor.* | Who is calling (How access is decided) |
# Signed-in users manage their own folder; anyone signed in may read "shared/"
ALLOW IF ctx.resource.name == "documents" AND ctx.storage.in_own_folder == True
ALLOW IF ctx.resource.name == "documents" AND ctx.action IN ["READ", "LIST"] AND ctx.storage.folder == "shared" AND ctx.actor.is_anonymous == False- With no rule for a bucket, only the public flag decides. Anyone may read a public bucket's files, but listing them needs a rule that allows
LIST, or the bucket's own Listable switch (public_list: true). App users get nothing from a private bucket. - Creating, deleting a bucket, making it public or changing its limits is administration: app users need the
adminapp role for it, whatever the file rules say. - The Security advisor flags buckets without rules (Security advisor).
#Public URLs
Files in a public bucket have a permanent URL anyone can open, without a key:
const url = sovaria.storage.publicUrl('product-images', 'shoes/runner-01.webp')
// https://<project-ref>.sovarias.in/api/v1/store/public/<project-id>/product-images/shoes/runner-01.webpUse public buckets only for files meant for everyone (product images, logos). Anyone who knows or guesses a path can download it. Listing a public bucket's files is off unless you turn it on (public_list: true when you create or update the bucket, or a storage rule that allows LIST).
#Signed URLs
A signed URL lets anyone holding it download (or upload) one file until it expires — without signing in. Create it on behalf of a user who is allowed to read the file; it carries no other access.
// Share a private file for 10 minutes
const { url, expires_at } = await sovaria.storage.signDownload('invoices', `${user.id}/2026-10.pdf`, 600)
// Let the browser upload directly (create this on your server; the browser tells you file.size)
const upload = await sovaria.storage.signUpload('uploads', `${user.id}/video.mp4`, 900, { sizeBytes })
await fetch(upload.url, { method: 'PUT', body: file })supabase's two-step upload works the same in every SDK: createSignedUploadUrl(path) (on behalf of a user who may write there) gives a one-time URL and its token; uploadToSignedUrl(path, token, file) sends the file with no session. Download links take download to save the file (under a name you choose) and transform for a resized image (Image transformations).
const uploads = sovaria.storage.from('uploads')
const { data: link } = await uploads.createSignedUploadUrl(`${user.id}/video.mp4`, { size: file.size })
await uploads.uploadToSignedUrl(`${user.id}/video.mp4`, link.token, file)
const { data } = await uploads.createSignedUrl(`${user.id}/video.mp4`, 600, { download: 'my-video.mp4' })| Lifetime | expires_in seconds, from 1 second to 1 day (86,400). The SDKs default to 1 hour; the API defaults to 15 minutes when you leave it out. |
| Scope | One file, one method (download or upload). |
| Upload size | Pass sizeBytes (size_bytes over HTTP) with the file's exact size: the URL goes straight to storage and only accepts a file of that size, checked against the bucket's and your plan's file-size limit and your storage quota when you create it. Without a size, the URL uploads through Sovaria, which checks the limits as the bytes arrive. |
| Revoking | A signed URL can't be withdrawn before it expires — keep lifetimes short. Deleting or moving the file makes it stop working. |
#Caching and bandwidth
- Files are served with their stored content type; set
contentTypewhen uploading so browsers display them correctly. - Downloads count toward the monthly bandwidth allowance (Plan limits); public files that can be cached by browsers and CDNs save bandwidth.
- Signed URLs are unique per signing, so caches can't share them — prefer public buckets for popular public files.
| Free | Pro | Ultra | Team | Enterprise | |
|---|---|---|---|---|---|
| Storage CDN tier | Standard | Standard | Standard | Premium | Premium |
| Monthly bandwidth | 2,147,483,648 | 21,474,836,480 | 64,424,509,440 | 429,496,729,600 | 5,497,558,138,880 |
#Image transformations
Resized and re-encoded images on the fly — thumbnails, avatars, WebP for slow networks — on paid plans: getPublicUrl(path, { transform }), createSignedUrl(path, expiresIn, { transform }) and download(path, { transform }). Limits, caching and security: Image transformations.
#Files in HIPAA projects
In a project with HIPAA mode on, buckets can't be public (PHI_PUBLIC_BUCKET_DISABLED); share files with short-lived signed URLs instead (HIPAA mode and PHI projects).
#Not supported
- File versioning or a trash: replaced and deleted files are gone.
- Per-file metadata beyond the content type, size and timestamps.
#Coming from Firebase or Supabase?
| Platform | What this is called there |
|---|---|
| Firebase | Storage Security Rules and download URLs |
| Supabase | Supabase Storage policies and signed URLs |
| Sovaria | Access, links and delivery |
Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.