@gigamusic/storage
v3.0.0
Published
Storage provider abstraction for gigamusic. Ships a Cloudflare R2 driver with forced same-tab download disposition.
Readme
@gigamusic/storage
Storage provider interface for gigamusic. Ships a Cloudflare R2 driver as the only implementation; the layout leaves room for additional drivers later.
getPresignedDownloadUrl always bakes Content-Disposition: attachment into the signed URL so the consuming UI cannot accidentally break the same-tab-download UX.
import { createR2Provider } from "@gigamusic/storage";
const storage = createR2Provider({
accountId,
accessKeyId,
secretAccessKey,
bucket,
publicUrl,
});
const url = await storage.getPresignedDownloadUrl(track.storageKey, {
filename: "track.mp3",
contentType: "audio/mpeg",
});