UNPKG

@amplitude/plugin-session-replay-react-native

Version:

Amplitude Session Replay plugin for React Native

44 lines (41 loc) 1.82 kB
import { LogLevel } from '@amplitude/analytics-types'; /** * Masking levels for sensitive content in session replay. * * Declared as a string-literal union (rather than an `enum`) to match the * Session Replay browser SDK and avoid the const-enum inlining pitfalls of * string enums under aggressive compilers. Kept structurally identical to the * standalone `@amplitude/session-replay-react-native` SDK's `MaskLevel` so the * two packages stay in lockstep without coupling the plugin's runtime to the * standalone native module. * * - `light`: mask only inputs that are always sensitive (password, etc.). * - `medium`: mask all `<TextInput>` fields. * - `conservative`: mask all `<TextInput>` fields and all `<Text>` content. */ /** * Configuration for the Session Replay React Native plugin. * * Unlike the standalone `@amplitude/session-replay-react-native` SDK, the * plugin auto-sources `apiKey`, `deviceId`, `sessionId`, and `serverZone` * from the analytics client's `ReactNativeConfig` at `setup()` time, so * those fields are intentionally absent from the public plugin config. * The plugin also never shipped a deprecated top-level `maskLevel`, so no * input-boundary normalization (and no `SessionReplayConfigInternal` alias) * is needed here. */ export const getDefaultConfig = () => { return { autoStart: true, enableRemoteConfig: true, logLevel: LogLevel.Warn, // Intentionally left without a `maskLevel`: the effective default // (`'medium'`) is resolved once at the native boundary in `setup()`. // Baking it in here would make a partial user `privacyConfig` (e.g. `{}`) // unable to fall through to the `?? 'medium'` resolution. privacyConfig: {}, sampleRate: 0 }; }; export { LogLevel }; //# sourceMappingURL=session-replay-config.js.map