@statsig/react-bindings 3.18.0 → 3.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statsig/react-bindings",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"homepage": "https://github.com/statsig-io/js-client-monorepo",
|
|
6
6
|
"repository": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"directory": "packages/react-bindings"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@statsig/client-core": "3.18.
|
|
13
|
-
"@statsig/js-client": "3.18.
|
|
12
|
+
"@statsig/client-core": "3.18.2",
|
|
13
|
+
"@statsig/js-client": "3.18.2"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"react": "^16.6.3 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { StatsigUser } from '@statsig/client-core';
|
|
2
2
|
import { StatsigClient, StatsigOptions } from '@statsig/js-client';
|
|
3
|
-
export declare function useClientBootstrapInit(sdkKey: string, initialUser: StatsigUser, initialValues: string, statsigOptions?: StatsigOptions | null): StatsigClient;
|
|
3
|
+
export declare function useClientBootstrapInit(sdkKey: string, initialUser: StatsigUser, initialValues: string, statsigOptions?: StatsigOptions | null, useLegacyFormat?: boolean): StatsigClient;
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useClientBootstrapInit = void 0;
|
|
4
4
|
const js_client_1 = require("@statsig/js-client");
|
|
5
5
|
const useStatsigInternalClientFactoryBootstrap_1 = require("./useStatsigInternalClientFactoryBootstrap");
|
|
6
|
-
function useClientBootstrapInit(sdkKey, initialUser, initialValues, statsigOptions = null) {
|
|
6
|
+
function useClientBootstrapInit(sdkKey, initialUser, initialValues, statsigOptions = null, useLegacyFormat) {
|
|
7
7
|
return (0, useStatsigInternalClientFactoryBootstrap_1.useStatsigInternalClientFactoryBootstrap)((args) => new js_client_1.StatsigClient(args.sdkKey, args.initialUser, args.statsigOptions), {
|
|
8
8
|
sdkKey,
|
|
9
9
|
initialUser,
|
|
10
10
|
initialValues,
|
|
11
11
|
statsigOptions,
|
|
12
|
+
useLegacyFormat,
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
exports.useClientBootstrapInit = useClientBootstrapInit;
|
|
@@ -5,6 +5,7 @@ type FactoryArgs = {
|
|
|
5
5
|
initialUser: StatsigUser;
|
|
6
6
|
initialValues: string;
|
|
7
7
|
statsigOptions: StatsigOptions | null;
|
|
8
|
+
useLegacyFormat?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare function useStatsigInternalClientFactoryBootstrap<T extends StatsigClient>(factory: (args: FactoryArgs) => T, args: FactoryArgs): T;
|
|
10
11
|
export {};
|
|
@@ -11,7 +11,12 @@ function useStatsigInternalClientFactoryBootstrap(factory, args) {
|
|
|
11
11
|
}
|
|
12
12
|
const inst = factory(args);
|
|
13
13
|
clientRef.current = inst;
|
|
14
|
-
|
|
14
|
+
if (args.useLegacyFormat) {
|
|
15
|
+
inst.dataAdapter.setDataLegacy(args.initialValues, args.initialUser);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
inst.dataAdapter.setData(args.initialValues);
|
|
19
|
+
}
|
|
15
20
|
inst.initializeSync();
|
|
16
21
|
return inst;
|
|
17
22
|
}, []);
|