How to access quirk values in edge functions
Last updated: November 26, 2025
To access quirk values in edge functions, you need to enable quirks to be transitioned between server/edge/client environments. This is accomplished by configuring the CookieTransitionDataStore with experimental quirks support.
Configuration
When creating your Context in the edge function, include the following configuration:
const context = new Context({
manifest: manifest as ManifestV2,
defaultConsent: true,
transitionStore: new CookieTransitionDataStore({
cookieName: 'ufvd',
serverCookieValue: cookieValue,
quirkCookieName: 'ufvdqk',
quirkCookieValue: quirkCookieValue,
experimental_quirksEnabled: true,
}),
});The key settings for quirk access are:
quirkCookieName: 'ufvdqk'- Specifies the cookie name for storing quirk dataquirkCookieValue: quirkCookieValue- The actual quirk cookie value from the requestexperimental_quirksEnabled: true- Enables the experimental quirks feature
How it works
With this configuration, quirks are stored in cookies via the CookieTransitionDataStore, making them accessible on the server-side. This allows you to:
Check existing quirk values before setting new ones
Implement conditional logic based on current quirk states
Maintain quirk persistence across server and client environments
Once configured, you can access and manipulate quirk values in your edge function using the standard Context API methods.