This is a Jitsu.Classic documentation. For the lastest version, please visit docs.jitsu.com. Read about differences here.
sort: 1#
Installing with Npm or Yarn
EventNative is packaged and available as an npm module.
Use the following command to add it to your project:
npm
yarn
npm install --save @jitsu/eventnative
To initialize EventNative, please use:
const { eventN } = require('@jitsu/eventnative');
eventN.init({
key: '[API_KEY]',
...params
}, this.services.backendApiClient);
Please see the full list of parameters, a key parameter value is required.
Intercepting Segment events#
To intercept Segment event it's recommended to initialize interception explicitly rather than use segment_hook parameter:
eventN.init({ ... }, this.services.backendApiClient);
//Create analytics via npm module
const analytics = new Analytics();
//initialize interception explicitely
eventN.interceptAnalytics(analytics);