I have the integration set up, and have the code a...
# ask-questions
r
I have the integration set up, and have the code as follows:
Copy code
const 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,
            // Targeting attributes
            attributes: {
              id: "123",
              country: "US",
            },
            // 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!");
          }
f
Which feature is returning false?
I see my-feature is a 3 way test
Copy code
"variations": [true, true, false],
which means that one could get assigned to the false group
and since you're hard coding the id to "123", it will not change
🙌 2
r
If I remove that id, will it randomize which value returns?
right now the features are returning null
Screenshot 2024-10-03 at 1.36.56 PM.png