Frequently Asked Questions

A curated summary of the top questions asked on our Slack community, often relating to implementation, functionality, and building better products generally.
Statsig FAQs
ea Notion Univision Microsoft OpenAI affirm nyt calendly Tempo CharacterAI Class101 Ancestry
GENERAL

How can I migrate from `statsig-react` to `@statsig/js-client` while ensuring hooks like `useConfig` and `useExperiment` work correctly?

Date of slack thread: 4/25/24

Anonymous: Hi! I am trying to use the new Session Replay feature. We are currently using statsig-react so I am trying to migrate to @statsig/js-client. However, has this new SDK fully supporting hooks like useConfig, useExperiment etc? My app cannot load the configs properly after switching the way I initialize the client. Any help would be appreciated. Thanks!

Statbot: The documentation does not mention a “Session Replay” feature or the migration process from statsig-react to @statsig/js-client. However, it does provide information on hooks like useConfig and useExperiment which are available in the statsig-react SDK. These hooks are used to get a Statsig Dynamic Config and a Statsig Experiment, respectively, and they return a ConfigResult with an isLoading state and the actual config or experiment data (https://docs.statsig.com/client/reactSDK|source).

If your app is not loading configs properly after switching SDKs, here are some general debugging steps you can take:

  1. Ensure that you have followed the correct initialization process for the @statsig/js-client SDK, as the initialization process might differ from statsig-react.
  2. Verify that the SDK key is correct and that you are passing the necessary user object if required.
  3. Check if there are any errors in the console that could give more insight into what might be going wrong.
  4. Make sure that the hooks are being used within the context of a StatsigProvider if such a context is required by the new SDK.
  5. Review the migration guide or documentation provided by Statsig for any specific instructions on migrating from statsig-react to @statsig/js-client.

If you continue to experience issues, please share the specific error messages or behaviors you’re encountering so that a Statsig team member can assist you further.

Daniel (Statsig): Hey, you need to migrate to @statsig/js-client and @statsig/react-bindings. The docs could be a little clearer around this, I will update them.

Daniel (Statsig): Here is an example using the @statsig/react-bindings package: https://github.com/statsig-io/js-client-monorepo/blob/main/samples/react/src/ClientEventStreamExamplePage.tsx#L6

Anonymous: Hi Daniel - thanks for the help. I will update the gate check using client.checkGate() per the example. Thank you!

Statbot: This thread has been marked as resolved. Press below to re-open.

Join the #1 experimentation community

Connect with like-minded product leaders, data scientists, and engineers to share the latest in product experimentation.

Try Statsig Today

Get started for free. Add your whole team!

What builders love about us

OpenAI OpenAI
Brex Brex
Notion Notion
SoundCloud SoundCloud
Ancestry Ancestry
At OpenAI, we want to iterate as fast as possible. Statsig enables us to grow, scale, and learn efficiently. Integrating experimentation with product analytics and feature flagging has been crucial for quickly understanding and addressing our users' top priorities.
OpenAI
Dave Cummings
Engineering Manager, ChatGPT
Brex's mission is to help businesses move fast. Statsig is now helping our engineers move fast. It has been a game changer to automate the manual lift typical to running experiments and has helped product teams ship the right features to their users quickly.
Brex
Karandeep Anand
President
At Notion, we're continuously learning what our users value and want every team to run experiments to learn more. It’s also critical to maintain speed as a habit. Statsig's experimentation platform enables both this speed and learning for us.
Notion
Mengying Li
Data Science Manager
We evaluated Optimizely, LaunchDarkly, Split, and Eppo, but ultimately selected Statsig due to its comprehensive end-to-end integration. We wanted a complete solution rather than a partial one, including everything from the stats engine to data ingestion.
SoundCloud
Don Browning
SVP, Data & Platform Engineering
We only had so many analysts. Statsig provided the necessary tools to remove the bottleneck. I know that we are able to impact our key business metrics in a positive way with Statsig. We are definitely heading in the right direction with Statsig.
Ancestry
Partha Sarathi
Director of Engineering
We use cookies to ensure you get the best experience on our website.
Privacy Policy