The following examples showcase using the LaunchDarkly Vercel Edge SDK to evaluate feature flags in Vercel's Edge Runtime. Both examples require the use of the LaunchDarkly Vercel integration to push feature flag data into Vercel's Edge Config.
This example shows how to evaluate feature flags in Vercel's edge runtime using the LaunchDarkly Vercel SDK. Two primary use cases are highlighted:
- Bootstrapping feature flags from the edge runtime and consuming them in the LaunchDarkly Client-side SDK for React. This is leveraging feature flags in edge-rendered pages while still maintaining the events and ergonomics provided by the React SDK. You can see details in
app/layout.tsx
andcomponents/launchdarklyProvider.tsx
. - Evaluating feature flags in the Edge Middleware. This can be seen in
middleware.ts
.
https://hello-vercel-edge.vercel.app/
This is an example test app to showcase the usage of the Vercel LaunchDarkly SDK to evaluate a feature flag in a Route Handler using Vercel's edge runtime.