@statsig/expo-bindings 0.0.1-beta.16 → 0.0.1-beta.18

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,14 +1,13 @@
1
1
  {
2
2
  "name": "@statsig/expo-bindings",
3
- "version": "0.0.1-beta.16",
3
+ "version": "0.0.1-beta.18",
4
4
  "dependencies": {
5
- "@statsig/client-core": "0.0.1-beta.16",
6
- "@statsig/react-bindings": "0.0.1-beta.16",
7
- "@statsig/react-native-bindings": "0.0.1-beta.16"
5
+ "@statsig/client-core": "0.0.1-beta.18",
6
+ "@statsig/react-bindings": "0.0.1-beta.18",
7
+ "@statsig/react-native-core": "0.0.1-beta.17"
8
8
  },
9
9
  "peerDependencies": {
10
10
  "react-native": "0.*",
11
- "@react-native-async-storage/async-storage": "1.*",
12
11
  "expo-application": "5.*",
13
12
  "expo-device": "5.*"
14
13
  },
@@ -1 +1 @@
1
- export {};
1
+ export declare function GetStatsigMetadataAdditions(): Record<string, string | undefined>;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  var _a, _b, _c, _d;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.GetStatsigMetadataAdditions = void 0;
4
5
  const expo_application_1 = require("expo-application");
5
6
  const expo_device_1 = require("expo-device");
6
7
  const react_native_1 = require("react-native");
7
- const client_core_1 = require("@statsig/client-core");
8
8
  let locale = undefined;
9
9
  if (react_native_1.Platform.OS === 'android') {
10
10
  const i18nManager = react_native_1.NativeModules['I18nManager'];
@@ -15,11 +15,14 @@ if (react_native_1.Platform.OS === 'ios') {
15
15
  const settings = settingsManager === null || settingsManager === void 0 ? void 0 : settingsManager.settings;
16
16
  locale = (_d = (_b = settings === null || settings === void 0 ? void 0 : settings.AppLocale) !== null && _b !== void 0 ? _b : (_c = settings === null || settings === void 0 ? void 0 : settings.AppleLanguages) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : undefined;
17
17
  }
18
- client_core_1.StatsigMetadataProvider.add({
19
- appVersion: expo_application_1.nativeApplicationVersion !== null && expo_application_1.nativeApplicationVersion !== void 0 ? expo_application_1.nativeApplicationVersion : undefined,
20
- systemVersion: expo_device_1.osVersion !== null && expo_device_1.osVersion !== void 0 ? expo_device_1.osVersion : undefined,
21
- systemName: expo_device_1.osName !== null && expo_device_1.osName !== void 0 ? expo_device_1.osName : undefined,
22
- deviceModelName: expo_device_1.modelName !== null && expo_device_1.modelName !== void 0 ? expo_device_1.modelName : undefined,
23
- deviceModel: expo_device_1.modelId != null ? String(expo_device_1.modelId) : undefined,
24
- locale,
25
- });
18
+ function GetStatsigMetadataAdditions() {
19
+ return {
20
+ appVersion: expo_application_1.nativeApplicationVersion !== null && expo_application_1.nativeApplicationVersion !== void 0 ? expo_application_1.nativeApplicationVersion : undefined,
21
+ systemVersion: expo_device_1.osVersion !== null && expo_device_1.osVersion !== void 0 ? expo_device_1.osVersion : undefined,
22
+ systemName: expo_device_1.osName !== null && expo_device_1.osName !== void 0 ? expo_device_1.osName : undefined,
23
+ deviceModelName: expo_device_1.modelName !== null && expo_device_1.modelName !== void 0 ? expo_device_1.modelName : undefined,
24
+ deviceModel: expo_device_1.modelId != null ? String(expo_device_1.modelId) : undefined,
25
+ locale,
26
+ };
27
+ }
28
+ exports.GetStatsigMetadataAdditions = GetStatsigMetadataAdditions;
package/src/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import '@react-native-async-storage/async-storage';
2
- import './StatsigMetadataAdditions';
3
- export { StatsigContext, useGate, useDynamicConfig, useExperiment, useLayer, } from '@statsig/react-bindings';
4
- export { StatsigProviderRN as StatsigProviderExpo, warmCachingFromAsyncStorage, } from '@statsig/react-native-bindings';
1
+ import { warmCachingFromAsyncStorage } from '@statsig/react-native-core';
2
+ export { StatsigContext, useDynamicConfig, useExperiment, useGate, useLayer, useStatsigOnDeviceEvalClient, useStatsigClient, useStatsigUser, } from '@statsig/react-bindings';
3
+ declare const StatsigProviderExpo: (props: import("@statsig/react-bindings").StatsigProviderProps & {
4
+ cacheWarming: import("@statsig/react-native-core").StatsigAsyncCacheWarming;
5
+ }) => JSX.Element | null;
6
+ export { StatsigProviderExpo, warmCachingFromAsyncStorage };
package/src/index.js CHANGED
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warmCachingFromAsyncStorage = exports.StatsigProviderExpo = exports.useLayer = exports.useExperiment = exports.useDynamicConfig = exports.useGate = exports.StatsigContext = void 0;
4
- require("@react-native-async-storage/async-storage");
5
- require("./StatsigMetadataAdditions");
3
+ exports.warmCachingFromAsyncStorage = exports.StatsigProviderExpo = exports.useStatsigUser = exports.useStatsigClient = exports.useStatsigOnDeviceEvalClient = exports.useLayer = exports.useGate = exports.useExperiment = exports.useDynamicConfig = exports.StatsigContext = void 0;
4
+ const react_native_core_1 = require("@statsig/react-native-core");
5
+ Object.defineProperty(exports, "warmCachingFromAsyncStorage", { enumerable: true, get: function () { return react_native_core_1.warmCachingFromAsyncStorage; } });
6
+ const StatsigMetadataAdditions_1 = require("./StatsigMetadataAdditions");
6
7
  var react_bindings_1 = require("@statsig/react-bindings");
7
8
  Object.defineProperty(exports, "StatsigContext", { enumerable: true, get: function () { return react_bindings_1.StatsigContext; } });
8
- Object.defineProperty(exports, "useGate", { enumerable: true, get: function () { return react_bindings_1.useGate; } });
9
9
  Object.defineProperty(exports, "useDynamicConfig", { enumerable: true, get: function () { return react_bindings_1.useDynamicConfig; } });
10
10
  Object.defineProperty(exports, "useExperiment", { enumerable: true, get: function () { return react_bindings_1.useExperiment; } });
11
+ Object.defineProperty(exports, "useGate", { enumerable: true, get: function () { return react_bindings_1.useGate; } });
11
12
  Object.defineProperty(exports, "useLayer", { enumerable: true, get: function () { return react_bindings_1.useLayer; } });
12
- var react_native_bindings_1 = require("@statsig/react-native-bindings");
13
- Object.defineProperty(exports, "StatsigProviderExpo", { enumerable: true, get: function () { return react_native_bindings_1.StatsigProviderRN; } });
14
- Object.defineProperty(exports, "warmCachingFromAsyncStorage", { enumerable: true, get: function () { return react_native_bindings_1.warmCachingFromAsyncStorage; } });
13
+ Object.defineProperty(exports, "useStatsigOnDeviceEvalClient", { enumerable: true, get: function () { return react_bindings_1.useStatsigOnDeviceEvalClient; } });
14
+ Object.defineProperty(exports, "useStatsigClient", { enumerable: true, get: function () { return react_bindings_1.useStatsigClient; } });
15
+ Object.defineProperty(exports, "useStatsigUser", { enumerable: true, get: function () { return react_bindings_1.useStatsigUser; } });
16
+ const StatsigProviderExpo = (0, react_native_core_1.GetStatsigProviderWithCacheWarming)((0, StatsigMetadataAdditions_1.GetStatsigMetadataAdditions)());
17
+ exports.StatsigProviderExpo = StatsigProviderExpo;