@kameleoon/react-native-event-source
v1.2.0
Published
Kameleoon React Native EventSource
Readme
Kameleoon React Native EventSource
Introduction
Kameleoon React Native EventSource is a small helper package which provides default implementation for Kameleoon React Native SDK external EventSource, used for real-time configuration updates, built on top of react-native-event-source-ts library.
For more information refer to Official Kameleoon Documentation
Contents
Installation
- npm -
npm install @kameleoon/react-native-event-source - yarn -
yarn add @kameleoon/react-native-event-source - pnpm -
pnpm add @kameleoon/react-native-event-source - bun -
bun install @kameleoon/react-native-event-source
Requires @kameleoon/react-sdk 10.29.0 or later, or @kameleoon/javascript-sdk 4.27.0 or later.
Configuration
While using @kameleoon/react-sdk:
- Import
KameleoonEventSource - Instantiate and pass it to external SDK dependencies
import { createClient } from '@kameleoon/react-sdk';
import { KameleoonEventSource } from '@kameleoon/react-native-event-source';
const client = createClient({
siteCode: 'my_site_code',
externals: {
eventSource: new KameleoonEventSource(),
},
});While using @kameleoon/javascript-sdk:
- Import
KameleoonEventSource - Instantiate and pass it to external SDK dependencies
import { KameleoonClient } from '@kameleoon/javascript-sdk';
import { KameleoonEventSource } from '@kameleoon/react-native-event-source';
const client = new KameleoonClient({
siteCode: 'my_site_code',
externals: {
eventSource: new KameleoonEventSource(),
},
});