Registers a storage provider with the manager.
Unique identifier for the provider
The storage provider instance implementing the StorageProvider
interface
Whether this provider should be set as the default (defaults to false
)
Get a registered storage provider
Optional
name: stringProvider identifier, uses default if not specified
Storage provider instance
List all registered providers
Array of provider names
Get the default provider name
Default provider name or null
Set the default provider
Provider identifier
Uploads a file using the specified or default storage provider.
The file blob to upload
Optional
filename: stringOptional custom filename (defaults to auto-generated name)
Optional
providerName: stringOptional provider identifier (uses default if not specified)
A Promise that resolves to the storage upload result with URL and metadata
Download a file using the specified or default provider
The storage URL
Optional
providerName: stringOptional provider to use
Promise with file blob
List files using the specified or default provider
Optional
options: StorageListOptionsOptional filtering and pagination
Optional
providerName: stringOptional provider to use
Promise with file list
Delete a file using the specified or default provider
The storage URL
Optional
providerName: stringOptional provider to use
Promise with success status
Get list of registered storage provider names
Array of provider names
Get the default storage provider name
Default provider name or undefined
Manages multiple storage providers with a unified interface for file operations.
Remarks
The StorageManager provides a consistent API for uploading, downloading, and managing files across different storage backends including IPFS, Pinata, Google Drive, and server-managed storage. It handles provider registration, default provider selection, and automatic fallback scenarios for robust file operations.
Used internally by DataController for encrypted file storage, but can also be used directly for custom storage workflows. Each provider implements the
StorageProvider
interface to ensure consistent behavior across different storage backends.The manager supports provider-specific configurations and features while maintaining a uniform API surface for applications.
Example
See
[URL_PLACEHOLDER] | Storage Providers Guide for configuration details