Vercel Flags
How to build zero-CLS A/B tests with Next.js and Vercel Edge Config

How to build zero-CLS A/B tests with Next.js and Vercel Edge Config

3/23/2023

What this post added

This post details the implementation of a zero-CLS A/B testing engine using Next.js and Vercel Edge Config. It introduces a system for creating type-safe experiments, pre-rendering experiment variations using dynamic routes and `getStaticPaths`/`getStaticProps`, and serving experiments to users via Next.js Middleware rewrites powered by Edge Config. The engine ensures users remain in their experiment bucket using cookies and captures events with a React Context. It also addresses the challenge of long build times by generating a limited number of experiment combinations.

Read the original post ↗