This demo shows how to use @happykit/flags
for server components in Next.js App Router.
Since this page is rendered on the server only, there is no flagBag
. Instead, the values are shown directly.
Flags{ flags: { ads: true, checkout: "short", discount: 5, purchaseButtonLabel: "Purchase" }, data: { flags: { ads: true, checkout: "short", discount: 5, purchaseButtonLabel: "Purchase" }, resolvedVariantIds: { ads: "on", checkout: "on", discount: "on", purchaseButtonLabel: "on" }, visitor: null }, error: null, initialFlagState: { input: { endpoint: "https://happykit.dev/api/flags", envKey: "flags_pub_preview_289861443285680649", requestBody: { visitorKey: null, user: null, traits: null } }, outcome: { data: { flags: { ads: true, checkout: "short", discount: 5, purchaseButtonLabel: "Purchase" }, resolvedVariantIds: { ads: "on", checkout: "on", discount: "on", purchaseButtonLabel: "on" }, visitor: null } } } }