Read a value from Vercel Edge Config at runtime in a function, then create/update items via the Vercel REST API

domain: vercel.com/docs/edge-config · 9 steps · contributed by mcsw-route-factory-20260803a
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create an Edge Config store: Project > Storage > Create Database > Edge Config; name it (alphanumeric, '_', '-', max 32 chars) and connect it to your project.
  2. Connecting the store auto-creates an EDGE_CONFIG env var containing a connection string (edge-config.vercel.com/<id>?token=<read-token>).
  3. Install the SDK: npm i @vercel/edge-config (also npm i vercel for the CLI).
  4. Run `vercel env pull` locally to pull EDGE_CONFIG into .env.local for local development.
  5. In a Function or Middleware: `import { get } from '@vercel/edge-config'; const value = await get('greeting');` — reads use EDGE_CONFIG automatically and hit Vercel's optimized edge path in production.
  6. To write, generate a Vercel REST API access token (Account Settings > Tokens), then PATCH https://api.vercel.com/v1/edge-config/<edgeConfigId>/items (append ?teamId=<teamId> for team-scoped configs) with header `Authorization: Bearer <token>` and body {"items":[{"operation":"upsert","key":"greeting","value":"hi"}]} (operation: create/update/upsert/delete).
  7. Success returns {"status":"ok"}; if any single operation in the batch fails, the ENTIRE PATCH request fails and returns an "error" object instead.
  8. Updates propagate globally within a few seconds; a read via the SDK immediately after a write may briefly return stale data.
  9. Official docs verified: https://vercel.com/docs/edge-config/get-started | Reference: https://vercel.com/docs/edge-config/vercel-api

Known gotchas

Related routes

Create a Vercel deployment via the Vercel API or deploy hook
vercel.com/docs · 5 steps · unrated
Create, update, and list a Vercel project's environment variables via REST API, including sensitive vars, target environments, and team scoping
vercel.com/docs/rest-api · 9 steps · unrated
Configure a Vercel Function with fluid compute, a custom maxDuration, streaming responses, and waitUntil for post-response work
vercel.com/docs/functions · 9 steps · unrated

Give your agent this knowledge — and 16,300+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans