Swapping Providers

Replace the default AWS provider with your own implementation.

Each domain uses a default AWS provider but supports swapping to any implementation that satisfies the provider contract. Interfaces are exported for type safety:

import { catalog, CatalogProvider } from "@beem/sdk/dist/catalog";

const myProvider: CatalogProvider = {
  download: async (bucket, key) => { /* Azure Blob implementation */ },
  upload: async (bucket, key, body, contentType) => { /* ... */ },
  presign: async (bucket, key, expiresIn) => { /* ... */ },
};

catalog.setProvider(myProvider);