https://www.growthbook.io/ logo
Join Slack
Powered by
# sdk-react
  • b

    bright-jewelry-59615

    02/28/2024, 12:38 PM
    Hi there! I have a small question abound experiments: I have one feature and from each environments the same experiment. On dev and stage experiment is working. But on production I have the problem: have default variant and ready false. If I clean gbFeaturesCache, it works. Can somebody help with it?
  • c

    clever-house-61055

    04/08/2024, 2:26 PM
    Hi all! I have a question about using a version string attribute on feature flags with the react-sdk in a React Native app. In an upcoming version of our app, we would like to start passing our
    appVersion
    to growthbook to be able to turn on feature flags for only certain versions of the app. This was not part of our original growthbook implementation. We set up our version attribute following https://docs.growthbook.io/features/targeting#semantic-version-targeting. In testing older versions of the app, which are not passing
    appVersion
    as an attribute, we found that our app is crashing at the
    paddedVersionString
    function in the growthbook sdk. Is this a known issue? Is there a workaround that allows us to use this attribute on new versions of the app but will not crash older versions that are still out there?
    f
    • 2
    • 3
  • p

    powerful-cat-40421

    05/09/2024, 1:03 PM
    Hello team, I have an issue - currently in my project I have a mix of class and functional components. I understand to use a feature I am provided with a hook like useFeatureIsOn which will only work inside a functional component. Is there any way or alternative for class components that folks have used or what is the suggestion in this scenario?
  • g

    gray-horse-99680

    06/01/2024, 6:51 PM
    Hi team, I'm running a critical experiment on my company's homepage & have encountered a bug. I've raised it on Github. Can someone assist me with this issue? https://github.com/growthbook/growthbook/issues/2594 Thanks
    b
    f
    • 3
    • 14
  • e

    eager-postman-4020

    07/15/2024, 7:48 PM
    ✌️ Oh, hello!
    👋 1
  • e

    eager-postman-4020

    07/15/2024, 7:50 PM
    I am evaluating growthbook for my company, and was wondering, besides caching(at various points/mechanisms), if the api encounters an outage, does the cdn still return values? what is the company's stance on if there is an outage in the api essentially?
    f
    • 2
    • 18
  • e

    eager-postman-4020

    07/15/2024, 7:50 PM
    or do you recommend running the proxy server to help with this situation
    f
    • 2
    • 3
  • e

    eager-postman-4020

    07/16/2024, 5:30 PM
    hello again 👋 i'm playing around more with the sample nextjs app, and was trying out the hybrid route. it mentions to
    getDecryptedPayload
    to make sure we can make the initial client side render synchronous
    r
    • 2
    • 13
  • e

    eager-postman-4020

    07/16/2024, 5:30 PM
    but it seems like if I use that or just
    getPayload
    the results are the same, and in the client component it's still calling initSync?
    h
    • 2
    • 11
  • e

    eager-postman-4020

    07/24/2024, 4:31 PM
    hi, for the nextjs sample app, QQ: • in middleware it sets a cookie with a uuid, then puts that as an attribute on the gb instance in the server component and also the clientapp. is this uuid serving as just an example of an id attribute, or is this something that is needed by growthbook?
    r
    • 2
    • 7
  • f

    fierce-salesclerk-92514

    07/24/2024, 10:16 PM
    I hope this is the correct channel, but I’m just really struggling to get any metrics coming through. I can’t find a thorough step-by-step guide to setup GrowthBook with GA4 and Next.js anywhere. I have this setup for my next.js _app and experiments are dividing traffic correctly when I use the useExperiment hooks, however I can’t get any metric information coming through Growthbook. I’ve linked my Growthbook with bigquery, and can see events. But all I ever get is:
    No data yet. Make sure your experiment is tracking properly.
    Can anyone confirm if this initial SDK setup looks correct for the tracking metrics part. The documentation on this part specifically seems to be a bit lacking, so I’m not sure if I’ve done this first step correctly. Specifically, what ga4 id should I be using, to ensure I can get metrics easily in the growthbook dashboard.
    h
    • 2
    • 4
  • m

    miniature-keyboard-1929

    08/14/2024, 7:47 AM
    👋 Hey everyone! Im currently setting up sticky bucketing and fallback attributes and I'm struggling to see how to provide the fallback attribute during sdk initialization - do i just pass fallbackAttribute in the attributes section?
    h
    • 2
    • 1
  • s

    strong-mouse-55694

    09/09/2024, 2:24 PM
    We don't have any official guides at the moment, but our React SDK does support SSR, so it's possible and I imagine the Next.js examples will be helpful. I'll look at putting a guide together this week and keep you posted.
    🙌 1
    t
    • 2
    • 2
  • s

    swift-baker-98755

    10/14/2024, 3:06 PM
    hey there, I'm a bit confused with how we define environments on GrowthBook. It seems like by default there's a
    production
    and a
    dev
    environment - that's great, that's all I need. The problem is that there's only one SDK-connection and that is set to
    production
    only. In order to use both
    production
    and
    env
    do I need to: • create a second SDK-connection for the same project, and select
    dev
    environment? • on the react SDK side, use a different client-id (one for
    production
    and one for
    dev
    )? Because I can't find an environment property to set Please confirm. P.s this looks so complicated and I don't understand why it has to be 😕
  • m

    most-match-36440

    10/23/2024, 3:27 PM
    For backwards compatibility with a previous feature flag platform we have a provider that puts the status of all the feature flags from growthbook in a context, something like:
    Copy code
    export const FeatureFlagProvider: FC<PropsWithChildren> = ({ children }) => {
      const growthbook = useGrowthBook();
      const flags = ['foo', 'bar', 'fizz', 'buzz']
    
      return (
        <EnabledFeatureFlagsContext.Provider
          value={{
            flags: flags.filter(flag => growthbook?.isOn(flag)),
          }}>
          {children}
        </EnabledFeatureFlagsContext.Provider>
      );
    }
    I'd like to wrap that in an
    useMemo
    but the only way that I see that would work is to do something with the
    setRenderer
    function to update some kind of context that I use here. But that seems a bit extreme, is there something that
    useGrowthbook
    returns that I can tie the
    useMemo
    to?
  • e

    eager-postman-4020

    01/02/2025, 5:42 PM
    hi, researching sticky bucketing, and using nextjs. what is the best way to verify sticky bucketing is working as expected? it seems like I need to have a js-cookie compatible service for the backend, probably wrapping how nextjs does cookies server side.
  • e

    eager-postman-4020

    01/02/2025, 5:42 PM
    does that sound right? and use the existing cookie service client side
    s
    • 2
    • 1
  • c

    cool-doctor-39582

    01/30/2025, 4:56 AM
    Hello! I'm looking for some help getting started. I'm using the react sdk, and I think I have everything set up as described in the documentation, but my test feature (named
    test-feature
    ) is always returning
    false
    , Halp? Slack Conversation
  • b

    bulky-secretary-94623

    04/15/2025, 9:35 PM
    Hello, working with react 18.2.0 and run npm install @growthbook/growthbook-react, but i am getting: Unable to resolve path to module '@growthbook/growthbook/plugins'.eslintimport/no-unresolved module "/Users/jacobo/Documents/captura/shop-ui/node_modules/@growthbook/growthbook/dist/plugins/index" when importing: import { thirdPartyTrackingPlugin, autoAttributesPlugin } from '@growthbook/growthbook/plugins'; can someone help please
    s
    q
    • 3
    • 2
  • t

    thankful-country-87951

    04/29/2025, 12:44 AM
    hello! Since yesterday, all my experiments have been showing only the default value, even when the traffic is set as 100% to a different variant. Nothing has changed in the setup, and those experiments have been running for months. The odd thing is that they work locally, but not in production. Could anyone help me troubleshoot this? I'm using node 22, react sdk 0.26.0 and nextjs 12.3
    s
    n
    f
    • 4
    • 10
  • n

    narrow-lifeguard-42299

    04/29/2025, 11:53 PM
    hi there! we have two data sources in our growthbook setup - google analytics and snowflake. we're only been using google analytics, but i want to set up my first experiment using snowflake and need to add some targeting attributes to make that possible. how should i handle using two different data sources, with different attributes for each? any recommendations or best practices on how i can do that?
    • 1
    • 1
  • p

    prehistoric-horse-37258

    05/06/2025, 3:10 PM
    I'm trying to use bandit experiments on a Next JS App Router page. I'm getting multiple exposures and it seems it's because bandits rely on having sticky bucketing enabled. I haven't found a way to set up sticky bucketing on a server-side app router page. Is this currently not supported?
  • p

    prehistoric-horse-37258

    05/06/2025, 3:11 PM
    I've only tried the sticky bucketing solutions that use cookies, BTW. I think the sticky bucketing could work with the redis solution, but that is more challenging to set up.
    h
    • 2
    • 4
  • c

    cold-shampoo-2316

    07/17/2025, 1:23 PM
    We're using the growthbook react sdk and i'm trying to retrieve all the experiments the user is part of. i can see the list of experiments when using the growthbook chrome extension, but calling
    getAllResults
    returns an empty map. I saw this bug https://github.com/growthbook/growthbook/issues/3375 and i'm not sure if this is still broken or if i'm doing something wrong.
  • t

    thankful-country-87951

    09/01/2025, 3:10 AM
    I'm currently upgrading from version 0.26 to the latest, and I noticed that
    getGrowthBookSSRData
    and
    useGrowthBookSSR
    from
    packages/sdk-react/src/GrowthBookReact.tsx
    are now marked as deprecated. I can't find any mention in the docs of what I should be using instead, and they are still being referenced as the proper approach for SSR. Could anyone please clarify if they should be replaced with a different function or hook?
  • l

    little-balloon-64875

    09/04/2025, 1:49 PM
    Noticing that
    antiFlicker
    is deprecated with the React SDK...is there a better method to avoid page-to-page flicker/jumping with URL redirect testing? I've got the redirect working with Next.js, but it shows the first page very briefly before navigating to the second page. Preferably it could be handled with Middleware, does anyone have any resources on URL split testing with middleware? Right now everything in our setup is client side.
    b
    • 2
    • 2
  • n

    nutritious-garden-91325

    10/13/2025, 5:00 PM
    Hi there everyone, I have a quick question about your react-sdk: How does the React SDK handle custom headers when calling the
    /api/features/<sdk-key>
    endpoint? We need to insert a
    User-Agent
    header from the client-side mobile app because our test environment blocks requests that lack this header.
    s
    • 2
    • 4
  • s

    some-cartoon-89075

    10/16/2025, 10:57 AM
    Hello everyone, I’ve been using GrowthBook DevTools for my application, and it has always updated the UI immediately and worked flawlessly for years. Recently, I upgraded
    react
    and
    react-dom
    from version
    v18.3.1
    to the latest stable
    v19.2.0
    , and
    next
    from
    v14
    to
    v15
    . After that, the UI stopped updating in my local development server. I tried downgrading only the NextJs version back to
    v14
    , but the issue persisted. The UI updates correctly only when I revert both
    react
    and
    react-dom
    to version
    18.3.1
    . I investigated to find out when the issue first appeared, and it seems that starting from version 19.0.0-beta-4508873393-20240430. The local development version no longer responds to overridden value changes via GrowthBook DevTools, while the locally built version still works as expected. Thanks in advance.
    s
    • 2
    • 6
  • w

    wide-journalist-37256

    11/11/2025, 9:13 PM
    Hi team, I am new to GrowthBook. I am integrating my application with GrowthBook. My local Growth Book instance is set up. I have my own tracking of events (we don't use Amplitude or other standard CDP platforms). How do I initialize Growth Book so that I can embed all experiment lists in my tracking?
    s
    • 2
    • 1
  • s

    salmon-magazine-85974

    11/13/2025, 1:22 AM
    (This is the closest channel I could find) I'm using `@openfeature/growthbook-client-provider`now but I'm using the
    @openfeature/server-sdk
    on node.js. I got the error
    _GeneralError: Provider 'GrowthbookClientProvider' is intended for use on the client.
    I understand that the growth-client-provider is for client side right now, the question is as a user of openfeature API that plan to use growthbook , which provider should I use?
    s
    • 2
    • 2