Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ub.bitbros.in/llms.txt

Use this file to discover all available pages before exploring further.

Access storage methods via client.storage. Uploaded files are served from a public CDN — no extra configuration required.
Storage operations require your secret key (sk_live_...). These operations should only be performed server-side.

upload

Upload a file to storage.
upload(file: File | Blob | Buffer, filename?: string): Promise<UploadResponse>
Parameters
NameTypeRequiredDescription
fileFile | Blob | BufferYesThe file to upload.
filenamestringNoOverride the stored filename.
Returns (UploadResponse)
FieldTypeDescription
urlstringPublic CDN URL for the uploaded file.
pathstringStorage path — required to delete the file later.
provider'internal' | 'external'Whether the file is stored on urBackend or your own Supabase.
Store the path alongside the url in your database. You need it to delete the file.
Example — Node.js upload
const fs = require('fs');
const file = fs.readFileSync('./abc123.jpg');

const { url, path, provider } = await client.storage.upload(file, 'abc123.jpg');
console.log(url);  // 'https://cdn.example.com/uploads/abc123.jpg'
console.log(provider); // 'internal'

deleteFile

Delete a previously uploaded file by its storage path.
deleteFile(path: string): Promise<{ deleted: boolean }>
Parameters
NameTypeRequiredDescription
pathstringYesThe path returned by upload().

Limits

LimitValue
Max file size10 MB per file
Total storage per project20 MB (Free Tier)
Uploads that exceed 10 MB are rejected with a StorageError.