Vercel Edge Config Adapter
The Vercel Edge Config adapter stores your content schema in Vercel Edge Config, providing ultra-low-latency reads at the edge. Ideal for Vercel-hosted applications.
Installation
Section titled “Installation”npm install @useacms/cliConfiguration
Section titled “Configuration”import { defineConfig } from '@useacms/client';import { localFile, vercelEdgeConfig } from '@useacms/cli/adapters';
export default defineConfig({ dev: localFile({ path: './acms.json' }), production: vercelEdgeConfig({ token: process.env.VERCEL_TOKEN, edgeConfigId: process.env.EDGE_CONFIG_ID, }),});Options
Section titled “Options”| Option | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Vercel API token |
edgeConfigId | string | Yes | Edge Config store ID |
1. Create a Vercel API Token
Section titled “1. Create a Vercel API Token”- Go to Vercel Settings > Tokens.
- Create a new token with appropriate scope.
- Copy the token.
2. Create an Edge Config Store
Section titled “2. Create an Edge Config Store”- In your Vercel dashboard, go to Storage > Edge Config.
- Create a new Edge Config store.
- Copy the Edge Config ID.
3. Configure Environment Variables
Section titled “3. Configure Environment Variables”VERCEL_TOKEN=your_vercel_tokenEDGE_CONFIG_ID=ecfg_xxxxxxxxxxxxxxxxxxxxPush and pull work the same as any other adapter:
acms push # Upload to Edge Configacms pull # Download from Edge Configacms sync # Bi-directional syncHow It Works
Section titled “How It Works”- Read: Fetches content from Vercel Edge Config via the Edge Config API.
- Write: Updates the Edge Config store with the new schema.
Edge Config provides sub-millisecond reads at the edge, making it ideal for runtime content delivery.
Use Cases
Section titled “Use Cases”- Vercel-hosted apps — Native integration with Vercel’s infrastructure.
- Edge performance — Sub-millisecond reads globally.
- Runtime strategy — Best paired with
strategy: 'runtime'for dynamic content.
Limitations
Section titled “Limitations”- Requires a Vercel account and project.
- Edge Config has a size limit (512 KB on the free plan, more on paid plans).
- Write operations are eventually consistent.
Next Steps
Section titled “Next Steps”- Learn about Cloudflare KV as an alternative edge storage
- Explore Vercel deployment