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-wrapper
Using Yarn:
yarn add @smartlook/segment-react-native-plugin-smartlook smartlook-react-native-wrapper
Run pod install
after the installation to auto-link the Smartlook SDK.
Install Smartlook and Segment
Follow the React Native Smartlook SDK Installation guide to finish setup of
smartlook-react-native-wrapper
in 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() });