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

    astonishing-window-33175

    10/30/2023, 10:27 PM
    A further question arising from the above - why is the
    trackingCallback
    ‘_required_’ for A/B testing? I’m struggling to see what I would be analysing.
    r
    a
    • 3
    • 11
  • e

    eager-dream-60488

    12/04/2023, 8:11 AM
    Error: No SubtleCrypto implementation found Error: No SubtleCrypto implementation found at ?anon_0_ (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=md.simpals.app999&modulesOnly=false&runModule=true:506801:24) at next (native) How to add SubtleCrypto implementation ?
    r
    • 2
    • 5
  • l

    little-animal-79425

    12/16/2023, 8:45 AM
    Hi, we've integrated Growthbook in our repo(React+Redux) and were running a simple A/A test to check if we'd done the setup correctly. But for one GA event the results are skewed even though growthbook is getting the right count of data for the same event under Metrics tab. We confirmed the metric count is correct by querying the DB but on querying the DB for the experiment result the count is different from what's shown in Growthbook. Does anyone have any idea what could be causing the experiment result to be skewed?
    r
    • 2
    • 11
  • g

    gifted-continent-11866

    12/20/2023, 8:19 AM
    Hi, what would be the best way to add conditional feature checks, lets say I have made new "sold out" options for products thats sold out, we want to run an experiment on this new feature and track if the new options are better, but we only want to check to see if the feature is on / off when the sold out criteria is meet. There are other parts besides the sold out part that changes depending on this feature due to structure of the code. We currently useFeatureIsOn, but can't seem to figure out how to make it conditional, which I assume wouldn't be possible with the hook, but maybe some other form of feature check that also fits the tracking part as we only want to track the viewed experiment if it actual hit the criteria.
    r
    • 2
    • 2
  • m

    most-cpu-32455

    01/04/2024, 4:59 PM
    Hey, does anyone has a working example for the new NextJS app directory structure? The one in the documentation is still for the old pages one and doesnt seem to work with the app dir.
    r
    • 2
    • 3
  • f

    famous-kite-31398

    01/18/2024, 10:57 AM
    👋 Hello, team! I am working on growthbook client side experiments and just wanted to check if anyone knows how to get all the assignment data (bucket id, bucket label etc) in my react component?
    b
    r
    • 3
    • 3
  • 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
    • 9
  • 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.