Documentation Index
Fetch the complete documentation index at: https://mf2.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
@repo/feature-flags controls feature rollouts with boolean and multivariate flags. Supports per-user targeting, percentage-based rollouts, and A/B testing.
Usage
Server-side:
import { getFlag } from "@repo/feature-flags";
const showNewEditor = await getFlag("new-editor");
Client-side:
"use client";
import { useFlag } from "@repo/feature-flags";
const showBeta = useFlag("beta-features");
Defining Flags
import { defineFlags } from "@repo/feature-flags";
export const flags = defineFlags({
"new-editor": {
defaultValue: false,
description: "Enable the new rich text editor",
},
"beta-features": {
defaultValue: false,
targeting: { percentage: 10 },
},
});
Environment Variables
| Variable | Description |
|---|
FLAGS_SECRET | Secret key for flag evaluation |
Learn More