Hello! I’m in the process of trying out growthBook...
# ask-questions
d
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
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
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
@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
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
Is the
apiHost
and
clientKey
defined as
process.env.GROWTHBOOK_FEATURE_URL
in this code line?
t
Yeah we defined those in our .env file.