@amplitude/plugin-session-replay-react-native
Version:
Amplitude Session Replay plugin for React Native
55 lines (52 loc) • 2.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "LogLevel", {
enumerable: true,
get: function () {
return _analyticsTypes.LogLevel;
}
});
exports.getDefaultConfig = void 0;
var _analyticsTypes = require("@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.
*/
const getDefaultConfig = () => {
return {
autoStart: true,
enableRemoteConfig: true,
logLevel: _analyticsTypes.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
};
};
exports.getDefaultConfig = getDefaultConfig;
//# sourceMappingURL=session-replay-config.js.map