Skip to content

happykit/flags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

854dd72 · Apr 2, 2024
Jun 16, 2023
Jan 20, 2024
Sep 4, 2022
Apr 2, 2024
Mar 26, 2024
Sep 3, 2022
Sep 3, 2022
May 9, 2021
Jun 3, 2023
Mar 26, 2024
Apr 2, 2024
Sep 3, 2022
Sep 3, 2022

Repository files navigation


 

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.

Key Features

  • written for Next.js
  • integrate using a simple useFlags() hook or getFlags() function
  • supports App Router (Server Components & Client Components)
  • only 2 kB gzipped size
  • extremely fast flag responses (~50ms)
  • supports Server-Side Rendering and Static Site Generation
  • supports Middleware and Edge Functions
  • supports User Targeting, Custom Rules and Rollouts

Want to see a demo? HappyKit Flags Demo


Documentation

See the full documentation for setup instructions and usage guides.

Examples

This is roughly what the usage of feature flags looks like once you're up and running.

// pages/index.js
import { useFlags } from "flags/client";

export default function IndexPage(props) {
  const flagBag = useFlags();

  return flagBag.flags.greeting === "dog" ? "Who's a good boye" : "Hello";
}

The self documenting examples at flags.happykit.dev show how to use @happykit/flags for client-side, static and server-side rendering.

Full Tutorial

A full tutorial including setup instructions is published on frontend-digest.com.