polite-art-41130
07/21/2023, 5:30 PMfresh-football-47124
polite-art-41130
07/22/2023, 12:06 AMconst growthbookInstance = new GrowthBook({
apiHost: process.env.NUXT_ENV_GROWTHBOOK_URL,
clientKey: process.env.NUXT_ENV_GROWTHBOOK_KEY,
attributes: {
id: segmentData, // Segment anon id
},
enableDevMode: isDev,
});
await growthbookInstance.loadFeatures({ autoRefresh: true });
const expVariant = growthbookInstance.getFeatureValue('exp_example', '0');
fresh-football-47124
const result = gb.evalFeature("exp_example");
console.log(result);
You’ll notice that sometimes the experiment isn’t loading and it’s serving the default value.
https://docs.growthbook.io/lib/js#evalfeaturepolite-art-41130
07/24/2023, 4:27 PMevalFeature
. I will add that and see if that helps to debug.fresh-football-47124
polite-art-41130
07/24/2023, 9:31 PMtrackingCallback
to send to our analytics and it seems to be splitting more evenly now.