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:
@statsig/js-client
SDK, as the initialization process might differ from statsig-react
.StatsigProvider
if such a context is required by the new SDK.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.