Blobs (files)
import { Aside } from ‘@astrojs/starlight/components’;
Upload and serve files. Access via sdk.blobs.
Methods
Section titled “Methods”upload(file, { filename?, mimeType? }): Promise<BlobInfo>get(id): Promise<BlobInfo | null>getDownloadUrl(id): Promise<string> // short-lived, direct from R2 — preferredgetUrl(id): string // Worker-proxied, long-liveddelete(id): Promise<boolean>list({ limit?, offset? }): Promise<BlobListResult>storage(): Promise<StorageInfo>Examples
Section titled “Examples”const file = document.querySelector('input[type=file]').files[0];const blob = await sdk.blobs.upload(file);
// Large media — get a fresh signed URL each time you need itimgEl.src = await sdk.blobs.getDownloadUrl(blob.id);
const { used, limit } = await sdk.blobs.storage();Limits & types
Section titled “Limits & types”| Constraint | Value |
|---|---|
| Per file | 50 MB |
| Per artifact | 500 MB |
| Max blobs | 1000 |
Allowed: images (PNG/JPEG/GIF/WebP/SVG), video (MP4/WebM), audio (MP3/WAV/OGG), PDF, TXT, CSV, Markdown.
Manifest
Section titled “Manifest”<script type="shareout/manifest">{ "version": "2.0", "sources": { "blobs": ["logo.png", "document.pdf"] } }</script>REST equivalents: Blobs API.