@amplitude/plugin-session-replay-react-native
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

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

Amplitude Session Replay plugin for React Native

Installation

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

Usage

Add the session replay plugin to your Amplitude instance as follows

import { SessionReplayPlugin } from '@amplitude/plugin-session-replay-react-native';

// ...

const config: SessionReplayConfig = {
    enableRemoteConfig: true, // default true
    sampleRate: 1, // default 0
    logLevel: LogLevel.Warn, // default LogLevel.Warn
};
await init('YOUR_API_KEY').promise;
await add(new SessionReplayPlugin(config)).promise;

Masking views

To maks certain views, add the AmpMaskView tag with the mask property amp-mask around the section to be masked

import { AmpMaskView } from '@amplitude/plugin-session-replay-react-native';

// ...

<AmpMaskView mask="amp-mask">
    <Text
    style={[
        styles.sectionTitle,
        {
        color: isDarkMode ? Colors.white : Colors.black,
        },
    ]}
    >
    {title}
    </Text>
</AmpMaskView>

Unmasking views

To unmask views, add the AmpMaskView tag with the mask property amp-unmask around the section to be unmasked

import { AmpMaskView } from '@amplitude/plugin-session-replay-react-native';

// ...

<AmpMaskView mask="amp-unmask">
    <Text
    style={[
        styles.sectionTitle,
        {
        color: isDarkMode ? Colors.white : Colors.black,
        },
    ]}
    >
    {title}
    </Text>
</AmpMaskView>

Tracking Web Views (Beta)

Web views are blocked by default and will not be tracked. If you'd like webviews to be tracked, you can manually unmask them by doing the following

<AmpMaskView mask="amp-unmask" style={{ flex: 1 }}>
    <WebView source={{ uri: 'https://reactnative.dev/' }} style={{ flex: 1 }} />
</AmpMaskView>

Package Sidebar

Install

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

Weekly Downloads

5,467

Version

0.4.3

License

MIT

Unpacked Size

50 kB

Total Files

58

Last publish

Collaborators

  • dnshi
  • rctbusk
  • curtisbliu
  • nutwani
  • kelson.warner
  • ajhorst_amp
  • brian.giori
  • sdk.dev
  • kevinpagtakhan
  • amplicynthia
  • jimmynotjim