Add Feature Flags to your Next.js application with a single React Hook. This package integrates your Next.js application with HappyKit Flags. Create a free happykit.dev account to get started.
- written for Next.js
- integrate using a simple
useFlags()
hook - only 5 kB in size
- extremely fast flag responses (~50ms)
- supports user targeting, custom rules and rollouts
- supports server-side rendering and static site generation
- supports _middleware (edge functions)
See the full documentation for setup instructions and usage guides.
This is roughly what the usage of feature flags looks like once you're up and running.
// pages/index.js
import { useFlags } from "@happykit/flags/client";
export default function IndexPage(props) {
const { flags } = useFlags();
return flags?.xzibit ? 'Yo dawg' : 'Hello';
}
The self documenting examples at flags.happykit.dev show how to use @happykit/flags
for client-side, static and server-side rendering.
A full tutorial including setup instructions is publishd on frontend-digest.com.
Are you looking for the old docs? They are available under under the v0.3.0 tag.