Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Storage Providers

Storage providers are the connectors to the object store where encrypted file shards live. Applications use ManagedStorageProvider: DataPrism authorizes each operation with the current user session and returns a short-lived signed URL. The SDK does not accept cloud credentials.

The StorageProvider interface

interface StorageProvider {
  readonly id: string;
  put(key: string, data: Uint8Array): Promise<void>;
  get(key: string): Promise<Uint8Array>;   // throws if absent
  has(key: string): Promise<boolean>;       // existence check (used for dedup)
  delete(key: string): Promise<void>;       // idempotent
}

has(key) is what powers deduplication: before uploading a shard, the pipeline checks whether it already exists at the provider, and skips the upload if so. Managed storage uses a short-lived signed HEAD request.

ManagedStorageProvider

The managed provider is the default for browser and dashboard integrations. Supply the API URL, the bytes16 project ID, and a callback that returns the current Privy access token.

const storage = new ManagedStorageProvider({
  apiUrl: "https://api.dataprism.co",
  projectId: cloudId,
  getAccessToken,
});

The provider requests a separate URL for PUT, GET, HEAD, or DELETE. URLs expire after 60 seconds by default, are scoped on the server to the authenticated tenant and project, and cannot be changed to target another object path. If Privy rejects an expired token, the SDK asks the callback for a fresh token once. A revoked session remains denied.

MemoryProvider

An in-process reference implementation for tests, demos, and the browser.

const provider = new MemoryProvider("dataprism_managed");
provider.offline = true;   // simulate an outage (get/has/put fail)

MemoryProvider is demo/test behavior only. It is process-local and is not persistent storage.

ManagedStorageProvider and MemoryProvider are the only bundled implementations. Applications can implement StorageProvider for tests or specialized runtime adapters, but provider secrets are not part of the DataPrism slot schema or SDK API.

Copyright © 2026 DataPrism.