Creates a new callback-based storage provider.
User-provided storage operation callbacks.
Must include at minimum upload and download functions.
Uploads a file using the user-provided callback.
The blob to upload. Can be any Blob-compatible object including File.
Optionalfilename: stringOptional filename for the upload. If not provided, callback may generate a name.
Upload result containing URL and metadata
Downloads a file using the user-provided callback.
The URL or identifier to download.
If extractIdentifier callback is provided, it will be used to extract the identifier.
The downloaded file as a Blob
Lists files using the user-provided callback.
Optionaloptions: StorageListOptionsOptional list options.
Pattern to filter files by name. Implementation depends on callback.
Maximum number of files to return. Implementation depends on callback.
Array of storage file metadata
Deletes a file using the user-provided callback.
The URL or identifier to delete.
If extractIdentifier callback is provided, it will be used to extract the identifier.
True if deletion succeeded, false otherwise
Delegates storage operations to user-provided callback functions.
Remarks
This provider enables custom storage integrations by delegating all operations to user-defined callbacks. It follows the same flexible pattern as relayer callbacks, allowing implementations via HTTP, WebSocket, direct cloud APIs, local filesystem, or any other backend.
The provider validates callback results and wraps errors in consistent
StorageErrortypes for uniform error handling across the SDK.Example