Storage
Per-project object storage on S3-compatible storage, with signed uploads so file bytes never pass through the API. It is covered end to end by a test that creates a bucket, uploads, confirms, downloads and cleans up.
On Excalibase Cloud
An app uploads through the SDK, in three steps it runs for you: a function mints a signed upload
URL, the file is PUT to it with exactly the declared type and size, and a second function accepts
the upload. The functions are system.generateUploadUrl and system.completeUpload by default.
Deploy your own under other names to decide who may upload: inside a function, ctx.storage trusts
the function that calls it, so the function is the project's storage rule.
import { createClient } from '@excalibase/sdk'
// A publishable key is safe in pages and browser bundles.
const PUBLISHABLE_KEY = 'esk_pub_live_Tb2pe6iauenJiWtTdBDMbeMp'
const db = createClient({
url: 'https://api.excalibase.io',
projectId: 'proj-jfp7kx46kb',
key: PUBLISHABLE_KEY,
})
await db.auth.signInWithApiKey()
const { storageId } = await db.storage.uploadFile(new Blob(['hello'], { type: 'text/plain' }))
console.log(storageId)
A browser app calls these from an origin on the project's CORS allowlist. Refuse a caller inside the
function with FunctionError so the app gets a 401 or 403; any other thrown error answers a bare 500.
Buckets and objects in Studio
Studio manages buckets and objects through the control plane at
https://app.excalibase.io/api/projects/{projectId}/storage/.... These routes need a signed-in Studio
session (Developer role for writes); an app does not call them, and without a session they answer 401.
curl -s "https://app.excalibase.io/api/projects/proj-jfp7kx46kb/storage/buckets"
Route (under /api/projects/{projectId}/storage) | Purpose |
|---|---|
POST / GET /buckets | Create and list buckets. |
DELETE /buckets/{bucket} | Remove a bucket and every object in it. |
GET /buckets/{bucket}/objects | List objects, with prefix and limit. |
POST /buckets/{bucket}/upload-url | Signed URL to upload to; the body gives key, mimeType and size. |
POST /buckets/{bucket}/confirm-upload | Record the object once uploaded; the body gives key and uploadId. |
GET /buckets/{bucket}/download-url/* | Signed URL to download. |
DELETE /buckets/{bucket}/objects/* | Delete an object. |
The bytes of an upload land on a staging key and are copied across only once the platform has read them back and accepted their size and type, so an upload that breaks the bucket's limits never replaces what is stored. Resumable uploads are supported for large files.
Not yet available
- Image transformations such as resize, crop and format conversion.
- Per-bucket and per-user quota management.
- Fine-grained access policies beyond public and authenticated objects.
Self-hosting
In the all-in-one deployment the same routes are served by the control plane of your own install
(replace https://app.excalibase.io), and public objects are served at
/storage/v1/object/public/{projectId}/{bucket}/*. That public route is not served on
api.excalibase.io.
Want This Feature?
Star the repo and open a feature request to help prioritize: