Netlify Blobs
Netlify Blobs via @netlify/blobs. Auto-detects siteID and token on Netlify runtimes; falls back to env vars elsewhere.
Installation
@netlify/blobs is an optional peer dependency of files-sdk - install alongside the SDK so the adapter's imports resolve at runtime.
Netlify Blobs via the official @netlify/blobs SDK. On Netlify runtimes (Functions, Edge Functions, build steps), siteID and token are auto-detected from NETLIFY_BLOBS_CONTEXT - pass them explicitly only when running outside Netlify. Falls back to NETLIFY_SITE_ID + NETLIFY_API_TOKEN (or NETLIFY_BLOBS_TOKEN) from env.
import { Files } from "files-sdk";import { netlifyBlobs } from "files-sdk/netlify-blobs";// On Netlify Functions / Edge / build runtimes, siteID + token are// auto-detected from NETLIFY_BLOBS_CONTEXT - pass them explicitly only// when running outside Netlify (e.g. local scripts, your own server).const files = new Files({ adapter: netlifyBlobs({ name: "uploads", // siteID: process.env.NETLIFY_SITE_ID, // token: process.env.NETLIFY_API_TOKEN, // deployScoped: false, // true uses getDeployStore() // consistency: "eventual", // or "strong" }),});Netlify Blobs has no native size, content-type, or last-modified fields, so the adapter packs them - plus cacheControl and user metadata - into Netlify's metadata map at upload time. head() and download() read them back, so the unified StoredFile shape works the same as on the cloud adapters.
Options
Limitations
url() throws - Netlify Blobs has no public URL primitive; reads always go through the SDK with the token. Use download() instead. signedUploadUrl() throws - there is no presigned upload primitive; uploads must go through the SDK or be proxied by your application.
copy() is a read-then-write - Netlify has no server-side copy primitive, so the source is fetched and re-written at the destination. Not server-side atomic. list() only carries key + etag from Netlify; size, content type, and last-modified come from a follow-up head() per item, so list entries return size: 0 and type: "application/octet-stream" by default. The unified cursor is not honoured because Netlify's pagination cursor is internal to the SDK, but the adapter iterates the SDK's paginated form and stops once limit is satisfied - so limit does bound server-side I/O. Stream uploads are buffered up-front because Netlify's set() has no streaming form.