API Reference
The SDK reference.
Every method, option and example for the AppVibezz tracking SDK, for React Native, Web, Node.js and Expo.
Install
Install & initialize
Add the package from npm, import AppVibezz and call init() once with your API key.
Terminal
# npm npm install appvibezz # React Native also needs AsyncStorage npm install @react-native-async-storage/async-storage
App.tsx
import { AppVibezz } from 'appvibezz';
AppVibezz.init({ apiKey: 'YOUR_API_KEY' });Methods
Method reference
The full SDK surface, every method is available on the AppVibezz object.
AppVibezz.init(config)Initialize the SDK
AppVibezz.identify(userId)Set the user ID
AppVibezz.track(event, props?)Track a custom event
AppVibezz.screen(name, props?)Track a screen view
AppVibezz.revenue(amount, currency?, props?)Track a purchase
AppVibezz.setUserProperty(key, value)Set a user property
AppVibezz.setAdvertisingId(id)Set IDFA / GAID
AppVibezz.trackNavigation(ref)Auto-track React Navigation
AppVibezz.flush()Force flush queued events
AppVibezz.reset()Clear user state (logout)
AppVibezz.shutdown()Stop the SDK & flush remaining events
Configuration
Configuration options
Pass these to init(). Only apiKey is required; the rest fall back to sensible defaults.
init options
AppVibezz.init({ apiKey: 'YOUR_API_KEY', // Required endpoint: 'https://...', // Custom endpoint (optional) flushInterval: 5000, // Flush interval in ms (default 5000) maxBatchSize: 50, // Max events per batch (default 50) sessionTimeout: 1800000, // Session timeout in ms (default 30 min) autoTrack: true, // Auto first_open/app_open (default true) debug: false, // Console logging (default false) });
Example
Track an event & revenue
Identify the user, track a custom event, then record a purchase.
checkout.ts
// Link events to the logged-in user AppVibezz.identify('user_12345'); // Track a custom event with properties AppVibezz.track('sign_up', { plan: 'premium' }); // Record a purchase AppVibezz.revenue(9.99, 'USD', { product_id: 'premium_monthly', transaction_id: 'txn_abc123', });
How it works
Queue, batch & retry
Events are added to an in-memory queue and persisted to storage, so they survive crashes and restarts. The queue is flushed in batches every 5 seconds (or when full), and failed requests are retried automatically.