Skip to content

appmetrica/appmetrica-react-native-plugin

Repository files navigation

@appmetrica/react-native-analytics

React Native bridge to the AppMetrica on both iOS and Android.

Installation

npm install @appmetrica/react-native-analytics

Usage

import AppMetrica from '@appmetrica/react-native-analytics';

// Starts the statistics collection process.
AppMetrica.activateWithConfig({
  apiKey: '...KEY...',
  sessionTimeout: 120,
  firstActivationAsUpdate: false,
});

// Sends a custom event message and additional parameters (optional).
AppMetrica.reportEvent('My event');
AppMetrica.reportEvent('My event', {foo: 'bar'});

// Send a custom error event.
AppMetrica.reportError('My error');