refined-rose-14039
10/05/2024, 10:32 AMconst gb = new GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey: "sdk-z2eQdvHSoRomlSFH",
// Enable easier debugging during development
enableDevMode: true,
// Update the instance in realtime as features change in GrowthBook
subscribeToChanges: true,
// Only required for A/B testing
// Called every time a user is put into an experiment
trackingCallback: (experiment, result) => {
console.log("Experiment Viewed", {
experimentId: experiment.key,
variationId: result.key,
});
},
});
// Use an async function to initialize GrowthBook
async function initializeGrowthBook() {
// Download features and experiments from the CDN
await gb.init();
console.log("GrowthBook initialized");
}
initializeGrowthBook(); // Call the async function
console.log(gb);
if (gb.isOn("my-feature")) {
console.log("Feature enabled!");
}
plain-scooter-8648
10/06/2024, 1:08 AMconsole.log("GrowthBook initialized");
refined-rose-14039
10/07/2024, 6:59 PMplain-scooter-8648
10/07/2024, 7:42 PMplain-scooter-8648
10/07/2024, 7:43 PMrefined-rose-14039
10/08/2024, 8:03 PMrefined-rose-14039
10/08/2024, 8:21 PM