@kameleoon/react-native-secure-prng
v1.0.1
Published
Kameleoon React Native Secure Pseudorandom Number Generator
Downloads
568
Readme
Kameleoon React Native EventSource
Introduction
Kameleoon React Native Secure Pseudorandom Number Generator (PRNG) is a small helper package which provides default implementation for Kameleoon React Native SDK external PRNG built on top of react-native-get-random-values
library.
It can be used to provide a secure PRNG implementation for Kameleoon React Native SDK due to some versions of Hermes engine not supporting crypto
module and providing weak Math.random
implementation that can lead to substantial biases in generated identifiers, which is especially important for external data integration tools like BigQuery.
For more information refer to Official Kameleoon Documentation
Contents
Installation
- npm -
npm install @kameleoon/react-native-secure-prng
- yarn -
yarn add @kameleoon/react-native-secure-prng
- pnpm -
pnpm add @kameleoon/react-native-secure-prng
- bun -
bun install @kameleoon/react-native-secure-prng
For iOS additionally run npx pod-install
to install dependencies
Configuration
While using @kameleoon/javascript-sdk
:
- Import
KameleoonEventSource
- Instantiate and pass it to external SDK dependencies
import { KameleoonClient } from '@kameleoon/javascript-sdk';
import { KameleoonSecurePRNG } from '@kameleoon/react-native-secure-prng';
const client = new KameleoonClient({
siteCode: 'my_site_code',
externals: {
securePRNG: new KameleoonSecurePRNG(),
},
});