@statsig/react-native-bindings 2.1.1 → 2.2.0-beta.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 +5 -4
- package/src/StatsigClientRN.d.ts +5 -0
- package/src/StatsigClientRN.js +11 -0
- package/src/StatsigProviderRN.js +11 -6
- package/src/index.d.ts +2 -2
- package/src/index.js +4 -2
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statsig/react-native-bindings",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-beta.2",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@statsig/client-core": "2.
|
|
6
|
-
"@statsig/
|
|
7
|
-
"@statsig/react-
|
|
5
|
+
"@statsig/client-core": "2.2.0-beta.2",
|
|
6
|
+
"@statsig/js-client": "2.2.0-beta.2",
|
|
7
|
+
"@statsig/react-bindings": "2.2.0-beta.2",
|
|
8
|
+
"@statsig/react-native-core": "2.2.0-beta.2"
|
|
8
9
|
},
|
|
9
10
|
"peerDependencies": {
|
|
10
11
|
"react": "^16.6.3 || ^17.0.0 || ^18.0.0",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StatsigOptions, StatsigUser } from '@statsig/js-client';
|
|
2
|
+
import { StatsigClientReactNativeBase } from '@statsig/react-native-core';
|
|
3
|
+
export declare class StatsigClientRN extends StatsigClientReactNativeBase {
|
|
4
|
+
constructor(sdkKey: string, user: StatsigUser, options?: StatsigOptions | null);
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatsigClientRN = void 0;
|
|
4
|
+
const react_native_core_1 = require("@statsig/react-native-core");
|
|
5
|
+
const StatsigMetadataAdditions_1 = require("./StatsigMetadataAdditions");
|
|
6
|
+
class StatsigClientRN extends react_native_core_1.StatsigClientReactNativeBase {
|
|
7
|
+
constructor(sdkKey, user, options = null) {
|
|
8
|
+
super(sdkKey, user, options, 'rn', (0, StatsigMetadataAdditions_1.GetStatsigMetadataAdditions)());
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.StatsigClientRN = StatsigClientRN;
|
package/src/StatsigProviderRN.js
CHANGED
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StatsigProviderRN = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
5
|
+
const react_bindings_1 = require("@statsig/react-bindings");
|
|
6
6
|
const react_native_core_1 = require("@statsig/react-native-core");
|
|
7
7
|
const StatsigMetadataAdditions_1 = require("./StatsigMetadataAdditions");
|
|
8
8
|
function StatsigProviderRN(props) {
|
|
9
|
-
(0, react_1.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const options = (0, react_1.useMemo)(() => {
|
|
10
|
+
var _a;
|
|
11
|
+
if ('client' in props) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const opts = (_a = props.options) !== null && _a !== void 0 ? _a : {};
|
|
15
|
+
(0, react_native_core_1._setupStatsigForReactNative)('rn', (0, StatsigMetadataAdditions_1.GetStatsigMetadataAdditions)(), opts);
|
|
16
|
+
return opts;
|
|
17
|
+
}, [props]);
|
|
18
|
+
return (0, react_bindings_1.StatsigProvider)(Object.assign(Object.assign({}, props), { options }));
|
|
14
19
|
}
|
|
15
20
|
exports.StatsigProviderRN = StatsigProviderRN;
|
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { StatsigProviderRN };
|
|
1
|
+
export { StatsigClientRN } from './StatsigClientRN';
|
|
2
|
+
export { StatsigProviderRN } from './StatsigProviderRN';
|
|
3
3
|
export * from '@statsig/react-bindings';
|
package/src/index.js
CHANGED
|
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.StatsigProviderRN = void 0;
|
|
18
|
-
|
|
17
|
+
exports.StatsigProviderRN = exports.StatsigClientRN = void 0;
|
|
18
|
+
var StatsigClientRN_1 = require("./StatsigClientRN");
|
|
19
|
+
Object.defineProperty(exports, "StatsigClientRN", { enumerable: true, get: function () { return StatsigClientRN_1.StatsigClientRN; } });
|
|
20
|
+
var StatsigProviderRN_1 = require("./StatsigProviderRN");
|
|
19
21
|
Object.defineProperty(exports, "StatsigProviderRN", { enumerable: true, get: function () { return StatsigProviderRN_1.StatsigProviderRN; } });
|
|
20
22
|
__exportStar(require("@statsig/react-bindings"), exports);
|