Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 1.7 KB

README.md

File metadata and controls

19 lines (11 loc) · 1.7 KB

LaunchDarkly Vercel Edge SDK examples

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:

  1. 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 and components/launchdarklyProvider.tsx.
  2. Evaluating feature flags in the Edge Middleware. This can be seen in middleware.ts.

Demo

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.