Server Side Rendering (Pure)

This demo is easiest to understand if you open its source code in a parallel tab.

Source code

This demo shows how to use @happykit/flags for server-rendered pages.

Since this page is rendered on the server only, there is no flagBag. Instead, the values are shown directly.

Flags
{ ads: true, checkout: "full", discount: 5, purchaseButtonLabel: "Buy now" }

Aside from the flags, we have access to the loaded flags as well. These are the flags without any fallback values.

Loaded data (without fallback values)
{ flags: { ads: true, checkout: "full", discount: 5, purchaseButtonLabel: "Buy now" }, resolvedVariantIds: { ads: "on", checkout: "1617854290624", discount: "on", purchaseButtonLabel: "off" }, visitor: { key: "WIerE2fl5_6nUgtqWBszR" } }