Skip to main content

Basic Configuration

The SDK is configured using a ZixflowConfig object with several options:
import { Zixflow, ZixflowConfig, ZixflowLogLevel } from 'zixflow-reactnative';

const config: ZixflowConfig = {
  apiKey: 'YOUR_API_KEY',
  logLevel: ZixflowLogLevel.debug,
  inApp: {
      },
  autoTrackDeviceAttributes: true,
  trackApplicationLifecycleEvents: true,
};
Configuration Options:
OptionTypeRequiredDescription
apiKeystringYesYour Zixflow API key
logLevelZixflowLogLevelNoLogging level (debug, info, error, none)
inAppobjectNoEnable in-app messaging (use empty object: )
autoTrackDeviceAttributesbooleanNoAutomatically track device info
trackApplicationLifecycleEventsbooleanNoAutomatically track app lifecycle

SDK Initialization

Initialize the SDK in your App.tsx or main component using useEffect:
import React, { useEffect } from 'react';
import { Zixflow, ZixflowConfig, ZixflowLogLevel } from 'zixflow-reactnative';

export default function App() {
  useEffect(() => {
    // Configure the SDK
    const config: ZixflowConfig = {
      apiKey: 'YOUR_API_KEY',
      logLevel: ZixflowLogLevel.debug,
      inApp: {
              },
      autoTrackDeviceAttributes: true,
      trackApplicationLifecycleEvents: true,
    };

    // Initialize the SDK
    Zixflow.initialize(config);

    console.log('Zixflow SDK initialized');
  }, []);

  return (
    // Your app UI
  );
}
Important: Initialize the SDK as early as possible in your app’s lifecycle, ideally in the root component’s useEffect.