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

ripe-oyster-41378

06/07/2023, 12:11 PM
hi i try this https://docs.growthbook.io/lib/react#server-side-rendering-ssr in next js and also enableDevMode use but its is showing .. plz help
Copy code
export function getServerSideGrowthBookContext(req) {
  // Set GrowthBook polyfills for server environments
  setPolyfills({
    fetch:  require("cross-fetch"),
    EventSource:  require("eventsource"),
    SubtleCrypto:  require("node:crypto")?.webcrypto?.subtle
  });

  return {
    apiHost: "<https://cdn.growthbook.io>",
    clientKey: "some_key",
    enableDevMode: true,
    attributes: {
      // TODO: get more targeting attributes from request context
      deviceId: "151515151",
    },
  }
}
4 Views