better-businessperson-31777
06/19/2025, 3:08 AMfresh-football-47124
fresh-football-47124
better-businessperson-31777
06/19/2025, 3:08 AM'use client';
import { GrowthBook } from '@growthbook/growthbook';
import { GrowthBookProvider } from '@growthbook/growthbook-react';
import { thirdPartyTrackingPlugin, autoAttributesPlugin } from '@growthbook/growthbook/plugins';
import { ReactNode, useEffect } from 'react';
export function GrowthBookInitProvider({ children }: { children: ReactNode }) {
// DO NOT SHIP THIS - THESE VALUES SHOULD COME FROM ENV
const growthbook = new GrowthBook({
apiHost: '<https://cdn.growthbook.io>',
clientKey: 'sdk-REDACTED',
enableDevMode: true,
plugins: [
// autoAttributesPlugin(),
thirdPartyTrackingPlugin({ trackers: ['segment'] }),
],
});
useEffect(() => {
// Load features asynchronously when the app renders
growthbook.init({ streaming: true });
}, []);
return <GrowthBookProvider growthbook={growthbook}>{children}</GrowthBookProvider>;
}
better-businessperson-31777
06/19/2025, 3:08 AMbetter-businessperson-31777
06/19/2025, 3:09 AMweb:build: Error occurred prerendering page "/model/competitors". Read more: <https://nextjs.org/docs/messages/prerender-error>
web:build:
web:build: Error: thirdPartyTrackingPlugin only works in the browser
better-businessperson-31777
06/19/2025, 3:10 AMbetter-businessperson-31777
06/19/2025, 3:11 AMbetter-businessperson-31777
06/19/2025, 3:20 AMfresh-football-47124
fresh-football-47124
better-businessperson-31777
06/19/2025, 3:24 AM