0.1.5 • Published 11 months ago

@taplytics/segment-react-native-plugin-taplytics v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@taplytics/segment-react-native-plugin-taplytics

DestinationPlugin for Taplytics. Wraps taplytics-react-native.

Installation

Install Segment React Native

Install the @segment/analytics-react-native dependency.

yarn add @segment/analytics-react-native @segment/sovran-react-native @react-native-async-storage/async-storage 
# or
npm install --save @segment/analytics-react-native @segment/sovran-react-native @react-native-async-storage/async-storage

Install the Taplytics React Native plugin

Install the @taplytics/segment-react-native-plugin-taplytics and the taplytics-react-native dependency.

Using NPM:

npm install --save @taplytics/segment-react-native-plugin-taplytics taplytics-react-native

Using Yarn:

yarn add @taplytics/segment-react-native-plugin-taplytics taplytics-react-native

Run pod install after the installation to autolink the Taplytics SDK.

Setup Taplytics

Follow the instructions to setup Taplytics for iOS and Android

See taplytics-react-native for more details of this dependency. See @segment/analytics-react-native for more details on how to add Segment analytics to your React Native app.

Usage

Follow the instructions for adding plugins on the main Analytics client:

In your code where you initialize the analytics client call the .add(plugin) method with a TaplyticsPlugin instance.

import { createClient } from '@segment/analytics-react-native';

import { TaplyticsPlugin } from '@taplytics/segment-react-native-plugin-taplytics';

const segmentClient = createClient({
  writeKey: 'SEGMENT_KEY'
});

segmentClient.add({ plugin: new TaplyticsPlugin() });