React Native

Setup

Jitsu supports Segment Analytics for React Native library to receive events from React Native applications.

Please follow the Installation instruction to install the library.

Tip

In all examples below, replace your-jitsu-domain.com with your Jitsu installation domain.

Jitsu Cloud users may find domain in the top-right corner of Site's Setup Instruction page or attach custom domain for a specific Site and use it instead.

Setting up the client

Jitsu requires additional settings to direct events to a correct Jitsu instance.

import { createClient } from '@segment/analytics-react-native';
 
const segmentClient = createClient({
  proxy: 'https://your-jitsu-domain.com/v1/batch',
  cdnProxy: 'https://your-jitsu-domain.com/v1/projects',
  writeKey: 'BROWSER_WRITE_KEY'
});

where:

Description
proxyJitsu server batch endpoint. E.g.: https://your-jitsu-domain.com/v1/batch
cdnProxyCDN host for settings retrieval. E.g.: https://your-jitsu-domain.com/v1/projects
writeKeyBrowser Write Key configured on Jitsu Site entity. If no Browser Write Key is added for Site entity, Site ID value can be used a Write Key. On Jitsu.Cloud can be omitted if Site has explicitly mapped domain name.

Event tracking

Please refer to the Analytics for React Native documentation for more details on how to track events with Jitsu.