Storage
Storage gives workspaces a place to save and retrieve files — screenshots, downloads, CSV exports, PDFs. Each workspace can have its own storage namespace, and multiple workspaces can share one.
Access via bctrl.storage(workspaceName).
upload(filePath, data, filename?)
Upload a file to workspace storage.
Returns UploadResult
uploadObject(data, options?)
Upload a file and register it in the object catalog. Use this when you want storage objects to be queryable by source, runtime, driver, etc.
Returns UploadObjectResult
get(filePath)
Download a file as raw bytes.
Returns Buffer
getDownloadUrl(filePath)
Get a presigned URL for direct download.
Returns string — presigned download URL.
browse(options?)
Browse files and folders with hierarchical listing.
Returns StorageBrowseResult
read(filePath, maxBytes?)
Read a UTF-8 text preview of a file.
Returns StorageReadResult
listObjects(options?)
List objects from the storage catalog with metadata filters.
Returns StorageObject[]
downloadObject(id)
Download an object by its catalog ID.
Returns Buffer
getObjectDownloadUrl(id)
Get a presigned URL for an object by catalog ID.
Returns string
getDownloadsZip()
Download all files as a single ZIP archive.
Returns Buffer — ZIP file content.
delete(filePath)
Delete a file by logical path.
deleteObject(id)
Delete an object by catalog ID.
deleteAll()
Delete all files in this workspace’s storage.
Returns number — count of deleted files.
forWorkspace(workspace)
Create a client for a different workspace namespace, preserving the same auth.
Returns StorageClient
Usage with workspaces
Storage is mounted to workspaces via the storage mount. See Scopes & Inheritance.

