This demo shows how to use @happykit/flags
for targeting users.
HappyKit allows you to do pass in a user. You can use that user and the provided uesr profile for rules or percentage-based rollouts. The fields supported in the user profile are defined in the README and in the TypeScript types.
Render #1 (Current render){ flags: { ads: false, checkout: "full", discount: 10, purchaseButtonLabel: "Buy now" }, data: { flags: { ads: false, checkout: "full", discount: 10, purchaseButtonLabel: "Buy now" }, resolvedVariantIds: { ads: "off", checkout: "1617854290624", discount: "off", purchaseButtonLabel: "off" }, visitor: { key: "dhx9AU5gGU7p0SU7OyTfQ" } }, error: null, fetching: false, settled: true, visitorKey: "dhx9AU5gGU7p0SU7OyTfQ" }
Note that aside from users, HappyKit also has the concepts of a visitor and traits. These three concepts are all independent of each other.