Storage

File storage, with the image work done for you.

Buckets, uploads, signed links and on-the-fly image transforms, from the same SDK as your data.

4
image output formats
2,500 px
maximum transform size
storage.tsTS
import { createClient } from '@aurabase/aurabase-js'
const aura = createClient(
'https://my-project.aurabase.cloud',
'aura_anon_xxx',
)
await aura.storage.createBucket('avatars', {
public: true,
fileSizeLimit: 5 * 1024 * 1024,
allowedMimeTypes: ['image/png', 'image/jpeg'],
})

What’s included

Everything a file needs. From upload to thumbnail.

Organization

Buckets with rules

Set a size limit and the allowed file types on each bucket.

Upload

Simple uploads

Send a file with a single call, with overwrite when you want it.

Download

Blob or stream

Download a file as a Blob, or read it as a stream.

Sharing

Signed URLs

Share a private file with a link that expires after the time you choose.

Public buckets

Public when you say so

Files in a public bucket are served to anyone, without an API key. Keep private files in a private bucket.

Images

On-the-fly image transforms

Resize, crop and convert images to JPEG, PNG, WebP or GIF with URL options. Results are cached on the server.

Files

Copy, move and list

Copy or move files inside a bucket, list by prefix and read metadata.

Safety

Trash before delete

Removing a file moves it to the trash. Permanent deletion needs the service role.

Server side

Signed uploads from your server

Create signed upload URLs with the service role so clients can upload without holding your keys.

How it works

From a file to a link.

  1. 1

    Create a bucket

    Choose public or private, a size limit and allowed types.

  2. 2

    Upload

    Send the file; the server returns its key.

  3. 3

    Share

    Use a public URL or a signed URL that expires.

  4. 4

    Transform

    Add width, height or format to the URL to get a derived image.

REST API

Prefer plain HTTP? It’s all here.

The SDK is a thin layer over these routes. Send your project’s API key with each request.

MethodEndpointDescription
GET/v1/storage/bucketsList buckets.
POST/v1/storage/bucketsCreate a bucket.
PATCH/v1/storage/buckets/{id}Update a bucket’s settings.
DELETE/v1/storage/buckets/{id}Delete a bucket.
POST/v1/storage/{bucket}Upload a file with multipart form data.
GET/v1/storage/{bucket}/{key}Download a file, optionally transformed.
DELETE/v1/storage/{bucket}/{key}Delete a file.
GET/v1/storage/{bucket}/meta/{key}Read a file’s metadata.
POST/v1/storage/{bucket}/copyCopy a file inside its bucket.
POST/v1/storage/{bucket}/moveMove a file inside its bucket.
GET/v1/storage/{bucket}/signed-urlCreate a time-limited download URL.
GET/v1/storage/{bucket}/upload-urlCreate a signed upload URL. Reserved to the service role.

Questions

Good to know.

Is a public bucket really public?+
Yes. Anyone with the URL can download its files, without an API key. Only put in a public bucket what you would put on the open internet.
How do I share a private file for a while?+
Create a signed URL with createSignedUrl() and a lifetime in seconds. The link stops working when it expires.
How large can an image transform be?+
Width and height are capped at 2,500 px. The quality setting applies to JPEG only.
Can I copy a file to another bucket?+
Not yet. Copy and move work inside a single bucket.
Are resumable uploads supported?+
No. Each upload is a single multipart request, so plan for files that fit in one request.
Can I turn off image transforms?+
Yes. Transforms are on by default, and a project can disable them. Requests with a transform are then refused.

Ready to store files?

Give your files a home today.

Storage is included in every project. No credit card required.