https://www.growthbook.io/ logo
d

delightful-activity-20153

01/23/2023, 3:48 PM
Hello! I’m in the process of trying out growthBook in our product. We use Vue and Nuxt for SSR. I’ve gotten the SDK in and have it reading my features etc, but i have a question about how growthbook handles Session cookies and client / server side invocations. is my assigned “group” saved in a cookie or how does growthbook know what group i was assigned to last time etc? is there a way for me to differentiate / see what values i’ve gotten assigned on clientside / serverside refresh etc? Do you have any built in support for vue
f

fresh-football-47124

01/23/2023, 4:02 PM
Hi Oscar
GrowthBook doesn’t store any cookies or state
we use deterministic hashing, so as long as the userId (or whatever attribute your using) is the same, and the experiment name is the same, they’ll get served the same variation
t

thankful-scientist-83252

01/23/2023, 5:17 PM
Our team just built a site with remix and growthbook. The loader function handled retrieving the features that we than pass down to the react templates at the highest level (app.tsx or index.tsx). Loosely based on this but we had to make some modifications https://github.com/t3dotgg/growthbook-remix
🙌 2
c

colossal-scooter-66825

04/13/2023, 3:50 PM
@thankful-scientist-83252 Great stuff! In the GrowthBook Setup instruction for React. Create a GrowthBook instance it has the apiHost and clientKey, where was it defined in the repo?
Copy code
import { GrowthBook } from "@growthbook/growthbook-react";

const growthbook = new GrowthBook({
  apiHost: "<https://cdn.growthbook.io>",
  clientKey: "sdk-XXXXX",
  enableDevMode: true,
  trackingCallback: (experiment, result) => {
    // TODO: Use your real analytics tracking system
    console.log("Viewed Experiment", {
      experimentId: experiment.key,
      variationId: result.key
    });
  }
});
t

thankful-scientist-83252

04/13/2023, 5:36 PM
Something like that yeah. We fetch the features from the cdn in the remix loader and then call setFeatures on the client if the features are not already set. That way they're be available on the first client render
c

colossal-scooter-66825

04/14/2023, 9:55 AM
Is the
apiHost
and
clientKey
defined as
process.env.GROWTHBOOK_FEATURE_URL
in this code line?
t

thankful-scientist-83252

04/14/2023, 9:31 PM
Yeah we defined those in our .env file.