new TappdSDK(config). Every option except appId is optional and ships with a sensible default. This page covers every available option, explains what it controls, and shows patterns for managing configuration across different environments.
Full Configuration Example
Use this as a starting point and remove any options you don’t need to override.Configuration Reference
Your unique App ID from the Tappd dashboard. This identifies your application and is required for every SDK operation. Retrieve it from Settings → Apps in your Tappd Dashboard.
The API endpoint the SDK sends data to. Leave this at the default unless you’re using a self-hosted instance or a custom domain.
When
true, the SDK automatically records app lifecycle events using React Native’s AppState API. Disable this only if you want to fire lifecycle events manually.The following events are tracked automatically when autoTrack is enabled:| Event | Triggered When |
|---|---|
app.opened | The app is launched from a cold start |
app.foreground | The app returns from the background |
app.background | The app moves to the background |
app.closed | The app closes, triggered by cleanup() |
The number of minutes of inactivity before the SDK starts a new session when the app returns to the foreground. Adjust this to reflect your app’s typical usage patterns — a longer timeout suits apps used in extended bursts, while a shorter timeout suits apps opened frequently for short tasks.
Enables automatic screen view tracking. This option does not track screens on its own — it must be paired with a manual
trackScreen() call inside each screen component (using useFocusEffect from React Navigation, for example). See the React Navigation integration guide for the full setup.Controls whether the SDK fetches and renders in-app messages (banners, popups, and modals) created in your Tappd dashboard. When enabled, you must also call
setMessageRenderCallback() to provide a React Native component that renders the message payload.See the In-App Messages guide for instructions on setting up
setMessageRenderCallback().When
true, the SDK automatically polls for pending in-app messages and displays them without any additional code. Set this to false if you want full manual control over when messages appear — for example, to display them only after specific user actions. Requires enableInAppMessages: true to have any effect.The number of seconds between polls for new in-app messages. Only applies when
autoDisplayMessages is true. Increase this value to reduce network activity in battery-sensitive contexts; decrease it if your messages need to appear quickly after they’re triggered.When
true, the SDK logs every operation to the console using React Native’s logging APIs. Use this during development to verify events are firing correctly and to diagnose unexpected behavior.Environment-Based Configuration
Development vs. Production
React Native exposes the__DEV__ boolean globally. Use it to toggle debug logging automatically based on the current build type.
Multiple Environments
If your project uses separate App IDs for development, staging, and production, define a config map and select the right entry based on__DEV__.
Using Environment Variables
Keep your App ID out of source control by loading it from environment variables withreact-native-config.
1. Create your .env file at the project root:
Add
.env to your .gitignore to avoid committing secrets. Provide a .env.example file with placeholder values so teammates know which variables to set.Best Practices
Next Steps
API Reference
Browse every method available on the TappdSDK instance with full parameter details.
Push Notifications
Configure FCM and APNs push token registration and subscription management.
In-App Messages
Set up render callbacks to display banners, popups, and modals from your dashboard.
Examples
See real-world configuration patterns and common integration scenarios.