Plugin
The DestinationPlugin for Smartlook wraps smartlook-react-native-wrapper.
Installation
Smartlook can be easily integrated into Segment by installing the @smartlook/segment-react-native-plugin-smartlook and the smartlook-react-native-wrapper dependency.
Using NPM:
npm install --save @smartlook/segment-react-native-plugin-smartlook smartlook-react-native-wrapperUsing Yarn:
yarn add @smartlook/segment-react-native-plugin-smartlook smartlook-react-native-wrapperRun pod install after the installation to auto-link the Smartlook SDK.
Install Smartlook and SegmentFollow the React Native Smartlook SDK Installation guide to finish setup of
smartlook-react-native-wrapperin your app.See @segment/analytics-react-native for a detailed guide on adding Segment to your app.
Usage
Follow the instructions for adding plugins on the main Analytics client:
Call the .add(plugin) method with a SmartlookPlugin instance in the code where you initialize the analytics client.
import { createClient } from '@segment/analytics-react-native';
import { SmartlookPlugin } from '@smartlook/segment-react-native-plugin-smartlook';
const segmentClient = createClient({
writeKey: 'SEGMENT_KEY'
});
segmentClient.add({ plugin: new SmartlookPlugin() });