DevRev SDK for React Native and Expo

Quickstart guide (Expo)

DevRev SDK, used for integrating DevRev services into your Expo app.

Requirements

  • React Native 0.79.0 or later.
  • For Expo apps, Expo 50.0.0 or later.
  • Android: minimum API level 24.
  • iOS: minimum deployment target 15.1.
  • Recommended: A locally configured SSH key registered on Github.

Installation

  1. To install the DevRev SDK, run the following command:
    npx expo install @devrev/sdk-react-native-expo-plugin
  2. Configure the Expo config plugin in your app.json or app.config.js:
    {
      "expo": {
        "plugins": [
          "@devrev/sdk-react-native-expo-plugin"
        ]
      }
    }
  3. Rebuild your app:
    npx expo prebuild --clean

Set up the DevRev SDK

  1. Open the DevRev web app at https://app.devrev.ai and go to the Settings page.
  2. Under Plug settings copy the value under Your unique App ID.
  3. Configure the DevRev SDK in your app using the obtained credentials.

The DevRev SDK must be configured before you can use any of its features.

The SDK is ready for use after the configuration API is called.

DevRev.configure(appID)

To provide a feature configuration during setup, use the overload that accepts it:

DevRev.configure(appID, featureConfiguration)

For default behavior, use the simpler form:

DevRev.configure('abcdefg12345')

To customize behavior such as frame capture, auto-start recording, or theme preferences, pass a full FeatureConfiguration object:

DevRev.configure('abcdefg12345', {
  enableFrameCapture: false,
  autoStartRecording: false,
  prefersDialogMode: false,
  alwaysUseRemoteConfig: true,
  supportWidgetTheme: {
    prefersSystemTheme: true,
  },
});

Update the feature configuration

Adjust the feature configuration without reconfiguring the SDK by passing a complete FeatureConfiguration object (all properties are required):

DevRev.updateFeatureConfiguration({
  enableFrameCapture: true,
  autoStartRecording: true,
  prefersDialogMode: false,
  alwaysUseRemoteConfig: true,
  supportWidgetTheme: {
    prefersSystemTheme: true,
  },
});

Feature configuration reference

FeatureConfiguration controls how the SDK behaves both during initial setup and when calling DevRev.updateFeatureConfiguration(...). All properties are required when providing a feature configuration.

PropertyTypeDefaultDescription
enableFrameCapturebooleantrueEnables the screen capture pipeline used by session replay.
autoStartRecordingbooleantrueAutomatically starts recording after the SDK finishes remote configuration.
prefersDialogModebooleanfalseEnables dialog mode for the support UI (Android only).
alwaysUseRemoteConfigbooleantrueIgnores local configuration and always fetches settings from the remote config service.
supportWidgetThemeSupportWidgetThemeControls the appearance of the in-app support widget, including dynamic theme behavior.

Support widget theme

SupportWidgetTheme controls the appearance of the support UI. Use the supportWidgetTheme property inside your feature configuration.

const customTheme = {
  prefersSystemTheme: false,
  primaryTextColor: '#1F2933',
  accentColor: '#F97316',
  spacing: {
    bottom: '20px',
    side: '16px',
  },
};
PropertyTypeDefaultDescription
prefersSystemThemebooleantrueFollows the device appearance when true; otherwise uses your custom colors.
primaryTextColorstring?Hex color string (e.g. '#000000', '#1F2933') for primary text in the support widget.
accentColorstring?Hex color string (e.g. '#F97316', '#FF0000') applied to buttons and highlights.
spacing{ [key: string]: string }?CSS-like spacing overrides (bottom and side keys are recognized).

Sample app

A sample app with use cases for the DevRev Expo plugin is available in the public repository. To set up and run the sample app:

  1. Go to the sample directory:

    cd sample/expo
  2. Install dependencies:

    yarn install
  3. Run clean and prebuild:

    npx expo prebuild --clean
  4. Run the app On Android:

    npx expo run:android

    OR open android in Android Studio and run the app.

  5. Run the app On iOS:

    npx expo run:ios

    OR open ios/DevRevSDKSample.xcworkspace in Xcode and run the app.

Last updated on