statsig-js
Version:
Statsig JavaScript client SDK for single user environments.
64 lines (63 loc) • 1.95 kB
TypeScript
import { _SDKPackageInfo } from './StatsigClient';
import { StatsigUser } from './StatsigUser';
export declare type DeviceInfo = {
getVersion(): string | null;
getSystemVersion(): string | null;
getSystemName(): string | null;
getModel(): string | null;
getDeviceId(): string | null;
};
export declare type ExpoConstants = {
nativeAppVersion: string | null;
nativeBuildVersion: string | null;
};
export declare type ExpoDevice = {
osVersion: string | null;
osName: string | null;
modelName: string | null;
modelId: string | null;
};
export declare type NativeModules = {
I18nManager?: {
localeIdentifier: string;
} | null;
SettingsManager?: {
settings: {
AppleLocale: string | null;
AppleLanguages: string[];
} | null;
} | null;
};
export declare type Platform = {
OS?: {
toLocaleLowerCase: () => string;
} | null;
};
export declare type UUID = {
v4(): string | number[];
};
export default class Identity {
private user;
private statsigMetadata;
private platform;
private nativeModules;
private reactNativeUUID?;
private sdkType;
private sdkVersion;
constructor(user: StatsigUser | null, overrideStableID?: string | null, reactNativeUUID?: UUID);
saveStableID(): void;
initAsync(): Promise<Identity>;
getSDKType(): string;
getSDKVersion(): string;
getStatsigMetadata(): Record<string, string>;
getUser(): StatsigUser | null;
updateUser(user: StatsigUser | null): void;
setSDKPackageInfo(SDKPackageInfo: _SDKPackageInfo): void;
setPlatform(platform: Platform): void;
setNativeModules(nativeModules: NativeModules): void;
private updateMetadataFromNativeModules;
private getUUID;
setRNDeviceInfo(deviceInfo: DeviceInfo): void;
setExpoConstants(expoConstants: ExpoConstants): void;
setExpoDevice(expoDevice: ExpoDevice): void;
}