Next.js + FeatBit

Run stable browser-level experiments without requiring login

Anonymous browser IDs let you keep the same visitor in the same FeatBit bucket across refreshes, which is what controlled rollout and experimentation actually need.

Open chat CTA is hidden because the flag is currently OFF.

One persistent connection

The Node SDK keeps one long-lived connection per server process instead of doing HTTP eval on every page load.

Local evaluation

After initialization, the actual variation lookup is local on the server, which removes the front-end wait you were concerned about.

SSR-first behavior

The page ships the chosen variation in the first HTML response, which avoids the common client-side flicker pattern.

Anonymous browser user

This demo now evaluates flags against a stable anonymous browser user instead of a hard-coded demo identity. As long as the visitor stays on the same browser profile, FeatBit will keep seeing the same user key.

Multivariate hero demo

This block is driven by the string flag homepage-hero-variant. Once you create it in FeatBit, the same anonymous browser should stay in the same variant bucket across refreshes.

experiment

Run stable browser-level experiments without requiring login

Anonymous browser IDs let you keep the same visitor in the same FeatBit bucket across refreshes, which is what controlled rollout and experimentation actually need.

Recommended env vars

  • Keep the secret only on the server. Do not expose it via public env vars.
  • Use a singleton client so hot reload and server restarts do not create a new connection on every render.
  • Render the first page with server-evaluated flags, then pass only the result to client components if needed.

Flag-controlled result

This panel is driven by the boolean flag homepage-show-chat-cta. With your current FeatBit setup, the value returned on the server is false.

Chat CTA is OFF, so the extra call-to-action button stays hidden.