netlify-blobs
Store and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module.
Skill by netlifyOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/netlify-netlify-blobs-7443a8
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, devops, cloud, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
netlify-blobs- Description
- Store and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module. Use when persisting user file uploads (images/documents), caching computed output from functions or Background Functions, serving downloadable assets, storing JSON blobs keyed by ID, or seeding deploy-specific data. Reach for this for key/value or object storage from Functions, Edge Functions, or Build Plugins — not for per-user, transactional, or relational data (use Netlify DB for that). Triggers include "save an uploaded file", "cache API results", "store generated site map", "key/value store for a function", or "file uploads without a database".
- License
- MIT
- Instructions
- 261 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Netlify Blobs
Modern syntax: import from `@netlify/blobs`, open a store, then call methods on the handle.
```ts
import { getStore, getDeployStore, listStores } from "@netlify/blobs";
import type { Context } from "@netlify/functions"; // or "@netlify/edge-functions"
```
In Functions, Edge Functions, and Build Plugins, `siteID`, `deployID`, `token` (and `region` for `getDeployStore`) are injected automatically. Install with `npm install @netlify/blobs`.
**Not a database.** For dynamic, per-user, transactional, or relational data, use Netlify DB. Blobs is for objects, files, and cache-like state. It is optimized for frequent reads and infrequent writes.
**Store scope is a footgun. Read this first.** `getStore` opens a **site-wide store shared across ALL deploy contexts**. Code on a deploy preview reads, overwrites, and deletes production data. Never run destructive tests or seed throwaway data from a preview against a site-wide store. Use `getDeployStore()` or a context-specific store name for isolation.
## Choosing a store type
- `getStore(name)`: site-wide and shared across all deploys. Data persists across deploys, and previews see production data.
- `getDeployStore(name)`: deploy-specific and scoped to one deploy. It stays in sync on rollback and is cleaned up on deploy deletion. Use it for isolation and for anything a failed deploy must not corrupt.
- **Build plugins can READ from any of the site's stores, but WRITE only to deploy-specific stores** (`getDeployStore`). File-based uploads also write only to deploy-specific stores.
## Core writes and reads
```ts
const uploads = getStore("file-uploads");
// set: value is ArrayBuffer | Blob | string
await uploads.set(key, file, { metadata: { country: "Spain" } });
// setJSON: any JSON-serializable value
await uploads.setJSON(key, { hello: "world" });
// get: returns value or null. type: text (default) | json | arrayBuffer | blob | stream
const entry = await uploads.get(key); // string
const obj = await uploads.get(key, { type: "json" });
if (entry === null) { /* 404 */ }
```
`set`/`setJSON` overwrite an existing key. Both return `{ modified, etag }`. `etag` is omitted when no new entry was generated.
### Persisting a user upload (Function)
```ts
import { getStore } from "@netlify/blobs";
import type { Context } from "@netlify/functions";
import { v4 as uuid } from "uuid";
export default async (req: Request, context: Context) => {
const form = await req.formData();
const file = form.get("file") as File;
const key = uuid();
const uploads = getStore("file-uploads");
await uploads.set(key, file, { metadata: { country: context.geo.country.name } });
return new Response("Submission saved");
};
```
Edge functions are identical except `import type { Context } from "@netlify/edge-functions";`.
### Reading (Function)
```ts
export default async (req: Request, context: Context) => {
const { key } = context.params;
const uploads = getStore("file-uploads");
const entry = await uploads.get(key);
if (entry === null) return new Response(`Not found: ${key}`, { status: 404 });
return new Response(entry);
};
```
## Metadata and conditional reads
**Null-check before destructuring.** `getWithMetadata` and `getMetadata` resolve to `null` when the key is absent. Destructuring the return value directly (`const { data } = await store.getWithMetadata(key)`) throws on a missing key. Assign the result to a variable, check for `null`, then read its fields.
```ts
// getWithMetadata: data + metadata + etag
const entry = await uploads.getWithMetadata(key);
if (entry === null) return new Response(`Not found: ${key}`, { status: 404 });
const { data, metadata } = entry;
return new Response(data, { headers: { "X-Country": metadata.country } });
// getMetadata: metadata + etag only, without downloading the blob
const meta = await uploads.getMetadata(key); // { etag, metadata } or null
if (meta === null) { /* missing */ }
```
Both accept `{ consistency, etag, type }`.
**Conditional read:** pass a cached `etag`. If it still matches server-side, `data` is `null`, which means your copy is fresh. Compare the whole ETag value, including surrounding quotes and any weakness prefix.
```ts
const entry = await uploads.getWithMetadata("my-key", { etag: cachedETag });
if (entry !== null && entry.etag === cachedETag) {
// entry.data is null: cached copy still fresh
}
```
## Concurrency: atomic conditional writes
**Last write wins. There is no concurrency control.** Do NOT build counters, balances, or read-modify-write logic on a blob key, even with `onlyIfMatch` retries. That is transactional data; use Netlify DB.
`set`/`setJSON` accept `{ onlyIfNew, onlyIfMatch }`:
```ts
// Create only if key does not exist
const { modified } = await emails.set("jane@netlify.com", "Jane Doe", { onlyIfNew: true });
if (!modified) return new Response("Email already exists", { status: 400 });
// Update only if the ETag still matches
const { modified } = await emails.set("jane@netlify.com", "New Jane", { onlyIfMatch: etag });
if (!modified) return new Response("Cached data is stale", { status: 400 });
```
## Listing
```ts
const { blobs } = await uploads.list(); // blobs: [{ etag, key }]
```From netlify/context-and-tools, MIT.
More from netlify/context-and-tools
- 0.761score
netlify-frameworks
netlifyOfficial
Deploy and configure web frameworks on Netlify — build settings and SSR/edge adapters plus local platform emulation and env vars.
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-identity
netlifyOfficial
Add user authentication to a Netlify site with @netlify/identity — signup/login/logout, Google/GitHub/GitLab/Bitbucket OAuth, server-side getUser() checks…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-access-control
netlifyOfficial
Picks the right Netlify site-protection layer and disambiguates the three unrelated "auth" concepts users conflate — app-user login (Netlify Identity)…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-mcp-servers
netlifyOfficial
Build, deploy, and secure Model Context Protocol (MCP) servers on Netlify.
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-deploy
netlifyOfficial
Create, configure, and manage Netlify deploys from code — reach for this when setting up Git continuous deployment, running netlify deploy or netlify deploy…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-database
netlifyOfficial
Zero-config Postgres for Netlify apps via @netlify/database — querying data from Functions/Edge Functions, writing schema migrations, setting up Drizzle ORM…
SkillAFreshness: A★ 43Claude Code +9 - 0.755score
netlify-agent-runner
netlifyOfficial
Run AI agent tasks remotely on Netlify using Claude, Codex, or Gemini.
SkillAFreshness: A★ 43Claude Code +9 - 0.755score
netlify-edge-functions
netlifyOfficial
Write, route, cache, and debug Netlify Edge Functions, the Deno-based TypeScript or JavaScript handlers in netlify/edge-functions that run at the network edge…
SkillAFreshness: A★ 43Claude Code +9 - 0.755score
netlify-functions
netlifyOfficial
Write, configure, and deploy Netlify serverless functions in TypeScript, JavaScript, or Go.
SkillAFreshness: A★ 43Claude Code +9 - 0.755score
netlify-ai-gateway
netlifyOfficial
Use Netlify AI Gateway to call OpenAI, Anthropic Claude, Google Gemini, TypeSafe (Jev), or OpenRouter-hosted models (xAI/DeepSeek/Meta/Mistral/Qwen) from…
SkillAFreshness: A★ 43Claude Code +9 - 0.755score
netlify-blobs
netlifyOfficial
Store and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module.
SkillAFreshness: A★ 43Claude Code +9 - 0.755score
netlify-caching
netlifyOfficial
Cache dynamic and static responses on Netlify's CDN from Functions, Edge Functions, and proxies.
SkillAFreshness: A★ 43Claude Code +9
Signals
- Stars
- 43
- Forks
- 13
- Open issues
- 3
- Last commit (this folder)
- Oct 22, 2026 (6 days ago)
- Last release
- Oct 8, 2026 (20 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/netlify/context-and-tools
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.755score
netlify-blobs
netlifyOfficial
Store and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module.
SkillAFreshness: A★ 43Claude Code +9 - 0.394score
netlify-blobs
netlifyOfficial
Store and retrieve unstructured objects, files, and cache-like state on Netlify with the @netlify/blobs module.
SkillAFreshness: A★ 43Claude Code +9
More from netlify
- 0.761score
netlify-frameworks
netlifyOfficial
Deploy and configure web frameworks on Netlify — build settings and SSR/edge adapters plus local platform emulation and env vars.
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-identity
netlifyOfficial
Add user authentication to a Netlify site with @netlify/identity — signup/login/logout, Google/GitHub/GitLab/Bitbucket OAuth, server-side getUser() checks…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-access-control
netlifyOfficial
Picks the right Netlify site-protection layer and disambiguates the three unrelated "auth" concepts users conflate — app-user login (Netlify Identity)…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-deploy
netlifyOfficial
Create, configure, and manage Netlify deploys from code — reach for this when setting up Git continuous deployment, running netlify deploy or netlify deploy…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-database
netlifyOfficial
Zero-config Postgres for Netlify apps via @netlify/database — querying data from Functions/Edge Functions, writing schema migrations, setting up Drizzle ORM…
SkillAFreshness: A★ 43Claude Code +9 - 0.761score
netlify-mcp-servers
netlifyOfficial
Build, deploy, and secure Model Context Protocol (MCP) servers on Netlify.
SkillAFreshness: A★ 43Claude Code +9
Cite this page
netlify-blobs skill. Agent Mart. https://agentmart.dev/skills/netlify-netlify-blobs-7443a8 (last updated 2026-10-24)