Vercel Edge Config
An Edge Config is a global data store that enables experimentation with feature flags, A/B testing, critical redirects, and more.Edge Config is available on all plans
An Edge Config is a global data store that enables experimentation with feature flags, A/B testing, critical redirects, and IP blocking. It enables you to read data at the edge without querying an external database or hitting upstream servers.
With Vercel's optimizations, you can read Edge Config data at negligible latency. The vast majority of your reads will complete within 15ms at P99, or as low as 0ms in some scenarios.
You can use an Edge Config in Edge Functions, Edge Middleware, and Serverless Functions.
Vercel's Edge Config read optimizations are only available on the Edge and Node.js runtimes. Optimizations can be enabled for other runtimes, such as Ruby, Go, and Python upon request. See our Edge Config limits docs to learn more.
Edge Configs are great for data that is accessed frequently and updated infrequently. Here are some examples of storage data suitable for Edge Config:
Feature flags and A/B testing: Experiment with A/B testing by storing feature flags in your Edge Config. Fetching such data from Edge Config rather than a database can cut page loads by hundreds of milliseconds. Deploy the template
Critical redirects: When you need to redirect a URL urgently, Edge Configs offer a fast solution that doesn't require you to redeploy your website. With Edge Middleware, you can read from your Edge Config to redirect users visiting incorrect URLs. For an example, see the Maintenance Page template .
Alternatively, use the Vercel WAF to configure a Redirect action based on specific conditions. For more details, check the emergency redirect example.
Malicious IP and User Agent blocking: Store a set of malicious IPs in your Edge Config, then block them upon detection without invoking upstream servers
You can create and manage your Edge Config from either Vercel REST API or Dashboard. You can scope your Edge Configs to your Hobby team or team, and connect them to as many projects as you want.
To get started, see our quickstart.
LaunchDarkly Integration example
Learn how to set up the LaunchDarkly integration to read flags from Edge Config
Dynamic Model Usage with AI SDK
A chatbot that allows you to dynamically set the LLM using Vercel AI SDK with Feature Flags and Edge Config
Maintenance Page
This template shows how to quickly trigger a maintenance page using Edge Config
If you'd like to know whether or not Edge Config can be integrated into your workflow, it's worth knowing the following:
- You can have one or more Edge Configs per Vercel account, depending on your plan as explained in Limits
- You can use multiple Edge Configs in one Vercel project
- Each Edge Config can be accessed by multiple Vercel projects
- Edge Configs can be scoped to different environments within projects using environment variables
- Edge Config access is secure by default. A read access token is required to read from them, and an API token is required to write to them
See our Edge Config limits docs to learn more
There are alternative solutions to Edge Config for handling A/B testing, feature flags, and IP blocking. The following table lays out how those solutions compare to Edge Config:
Edge Config vs alternatives | Read latency | Write latency | Redeployment required | Added risk of downtime |
---|---|---|---|---|
Edge Config | Ultra-low | Varies | No | No |
Remote JSON files | Varies | Varies | No | Yes |
Embedded JSON files | Lowest | Highest | Yes | No |
Environment Variables | Lowest | Highest | Yes | No |
To learn about Edge Config limits and pricing, see our Edge Config limits docs.
Quickstart
Create and read from your Edge Config in minutes.
Read with the SDK
Read from your Edge Config at the fastest speeds.
Use the Dashboard
Manage your Edge Configs in the Vercel dashboard.
Manage with the API
Manage your Edge Configs with the Vercel API.
Edge Config Limits
Learn about the limits of Edge Configs.
Was this helpful?