Nucleus Powered Mitochondria

    @smartlook/segment-react-native-plugin-smartlook
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    @smartlook/segment-react-native-plugin-smartlook

    DestinationPlugin for Smartlook. Wraps the react-native-smartlook-analytics package.

    Installation

    You need to install the @smartlook/segment-react-native-plugin-smartlook and the react-native-smartlook-analytics dependency.

    Using NPM:

    npm install --save @smartlook/segment-react-native-plugin-smartlook react-native-smartlook-analytics

    Using Yarn:

    yarn add @smartlook/segment-react-native-plugin-smartlook react-native-smartlook-analytics

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

    Follow the React Native Smartlook SDK Installation guide to finish the setup of react-native-smartlook-analytics in your app. See @segment/analytics-react-native for a detailed guide about adding the Segment Analytics to your 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 new SmartlookPlugin instance.

    import { createClient } from '@segment/analytics-react-native';
    import { SmartlookPlugin } from '@smartlook/segment-react-native-plugin-smartlook';
    import Smartlook from 'react-native-smartlook-analytics';
    
    const segmentClient = createClient({
      writeKey: 'SEGMENT_KEY'
    });
    
    Smartlook.instance.preferences.setProjectKey(
      'SMARTLOOK_KEY'
    );
    
    segmentClient.add({ plugin: new SmartlookPlugin() });

    Install

    npm i @smartlook/segment-react-native-plugin-smartlook

    DownloadsWeekly Downloads

    8

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    28.1 kB

    Total Files

    45

    Last publish

    Collaborators

    • c0mtru1se
    • samialdury
    • jakubpetriska
    • pjk
    • amertak
    • acro
    • janzal
    • millcek
    • joozty
    • klobinoid