An extension plugin for TelemetryDeck React SDK that automatically enriches every signal with rich Expo/React Native environment data and advanced session tracking — with just a few lines of code.
- Plug-and-play extension for TelemetryDeck React SDK — just add to
pluginsarray - Zero native code: fully implemented in TypeScript, built on top of Expo SDK modules (
expo-application,expo-device,expo-localization, etc.) - 40+ automatic parameters added to every TelemetryDeck signal:
- AppInfo: version, build number, version + build
- Device: model, OS, architecture, brand, orientation, screen resolution/density, timezone, …
- SDK: name, version, build type (debug / release)
- RunContext: locale, target environment, marketplace source, side-loaded flag
- Accessibility & UserPreferences: font scale, RTL / LTR, color scheme, bold text, reduce motion, …
- Calendar: day/week/month/quarter/year breakdown, hour of day, weekend flag
- Session & Retention: session tracking, distinct days used, retention metrics, acquisition analytics
- Advanced Session Tracking: automatic app lifecycle monitoring, persistent storage, 5-minute session timeout
- Retention Analytics: first session date, lifetime sessions, average duration, distinct days used, monthly retention
- Universal — works on iOS and Android (Expo*)
*Device‐specific metrics gracefully degrade on unsupported platforms - MIT-licensed, open-source
npm install telemetrydeck-expo-plugin
# or
yarn add telemetrydeck-expo-pluginThis plugin extends the TelemetryDeck React SDK and requires the following dependencies:
{
"@typedigital/telemetrydeck-react": "^0.4.1",
"@react-native-async-storage/async-storage": ">=1.0.0",
"expo": ">=49.0.0",
"expo-application": ">=5.0.0",
"expo-device": ">=5.0.0",
"expo-localization": ">=14.0.0",
"react": ">=16.8.0",
"react-native": ">=0.70.0"
}Install them if not already present:
npm install @typedigital/telemetrydeck-react @react-native-async-storage/async-storage
npx expo install expo-application expo-device expo-localizationThis plugin extends the TelemetryDeck React SDK by automatically adding Expo/React Native environment data to every signal. Simply add it to the plugins array when creating your TelemetryDeck instance:
import { createTelemetryDeck } from "@typedigital/telemetrydeck-react";
import { expoPlugin } from "telemetrydeck-expo-plugin";
const td = createTelemetryDeck({
app: "YOUR-APP-ID",
user: "anonymous",
plugins: [expoPlugin], // ← Add the Expo plugin here
});
// Use TelemetryDeck as usual - all signals now include rich Expo context
const { signal } = useTelemetryDeck();
signal("app_launched");For advanced session tracking and retention analytics, add the session enhancement plugin and initialize session tracking:
import { createTelemetryDeck } from "@typedigital/telemetrydeck-react";
import {
expoPlugin,
sessionEnhancementPlugin,
initSessionTracking,
} from "telemetrydeck-expo-plugin";
const td = createTelemetryDeck({
app: "YOUR-APP-ID",
user: "anonymous",
plugins: [
expoPlugin,
sessionEnhancementPlugin, // ← Add session enhancement
],
});
// Initialize session tracking
initSessionTracking(td);Use the React hook for automatic session tracking setup:
import { useSessionTracking } from "telemetrydeck-expo-plugin";
function App() {
useSessionTracking(); // ← Automatically handles session tracking
return <YourApp />;
}For complete TelemetryDeck React SDK documentation, see: https://github.com/typedigital/telemetrydeck-react
Every signal sent through TelemetryDeck will now automatically include rich context about the user's device, environment, preferences, and session metrics — no extra work required.
This plugin automatically enhances every TelemetryDeck signal with the following parameters:
TelemetryDeck.AppInfo.version- App version (e.g., "1.0.0")TelemetryDeck.AppInfo.buildNumber- Build number (e.g., "123")TelemetryDeck.AppInfo.versionAndBuildNumber- Combined version and build
TelemetryDeck.Device.architecture- CPU architecture (e.g., "arm64")TelemetryDeck.Device.modelName- Device model (e.g., "iPhone 14 Pro")TelemetryDeck.Device.operatingSystem- OS name (e.g., "iOS")TelemetryDeck.Device.platform- Platform (e.g., "ios", "android")TelemetryDeck.Device.systemVersion- OS version (e.g., "17.0")TelemetryDeck.Device.brand- Device brand (e.g., "Apple")TelemetryDeck.Device.orientation- Screen orientationTelemetryDeck.Device.screenResolution*- Screen dimensionsTelemetryDeck.Device.screenDensity- Pixel densityTelemetryDeck.Device.timeZone- User's timezone
TelemetryDeck.SDK.name- SDK nameTelemetryDeck.SDK.version- SDK versionTelemetryDeck.SDK.buildType- "debug" or "release"
TelemetryDeck.RunContext.locale- User's locale (e.g., "en-US")TelemetryDeck.RunContext.targetEnvironment- Target platformTelemetryDeck.RunContext.isSideLoaded- Whether app is side-loadedTelemetryDeck.RunContext.sourceMarketplace- App store source
TelemetryDeck.UserPreference.colorScheme- "Light" or "Dark"TelemetryDeck.UserPreference.layoutDirection- "leftToRight" or "rightToLeft"TelemetryDeck.UserPreference.language- User's languageTelemetryDeck.UserPreference.region- User's regionTelemetryDeck.Accessibility.fontScale- Font scaling factorTelemetryDeck.Accessibility.isBoldTextEnabled- Bold text preferenceTelemetryDeck.Accessibility.isReduceMotionEnabled- Reduce motion preference- And more accessibility settings...
TelemetryDeck.Calendar.dayOfMonth- Day of month (1-31)TelemetryDeck.Calendar.dayOfWeek- Day of week (1-7, Monday=1)TelemetryDeck.Calendar.monthOfYear- Month (1-12)TelemetryDeck.Calendar.quarterOfYear- Quarter (1-4)TelemetryDeck.Calendar.isWeekend- Weekend flagTelemetryDeck.Calendar.hourOfDay- Hour of day (0-23)
TelemetryDeck.Session.started- Session start timestamp
TelemetryDeck.Acquisition.FirstSessionDate- Date of first app usageTelemetryDeck.Retention.DistinctDaysUsed- Number of distinct days user used the appTelemetryDeck.Retention.DistinctDaysUsedLastMonth- Days used in last monthTelemetryDeck.Retention.TotalSessionsCount- Lifetime number of sessionsTelemetryDeck.Retention.AverageSessionSeconds- Average session durationTelemetryDeck.Retention.PreviousSessionSeconds- Duration of previous session
Automatic Session Signals:
TelemetryDeck.Session.started- Sent when a new session beginsTelemetryDeck.Acquisition.newInstallDetected- Sent on first app launch
To build the TypeScript sources:
npm run buildTo run tests:
npm testTo clean build artifacts:
npm run cleanTest files are located in src/__tests__/ and use Jest with babel-jest.
This project uses automated releases via GitHub Actions. To create a new release:
-
Update the version in
package.json:npm version patch # for bug fixes (1.0.0 → 1.0.1) npm version minor # for new features (1.0.0 → 1.1.0) npm version major # for breaking changes (1.0.0 → 2.0.0)
-
Push the version tag:
git push origin v1.0.1 # replace with your version -
Automated workflow will:
- Run tests and build the project
- Publish to npm with provenance
- Auto-generate changelog from commits and merged PRs
- Create a GitHub Release with release notes
- Update package badges and links
Note: The changelog is automatically generated from:
- All commits since the last release (with author names)
- Merged pull requests (with PR numbers and titles)
If you need to publish manually (not recommended):
npm run build
npm test
npm publishThe prepublishOnly script will automatically run build and tests before publishing.
Understanding who, where and how users run your app is crucial for actionable analytics. This plugin eliminates boilerplate and keeps your telemetry clean, consistent and privacy-respectful while giving you deep insights for product decisions.
PRs and issues are welcome! Please follow conventional-commits and respect the project's code of conduct.
- Clone the repository
- Install dependencies:
npm install - Run tests:
npm test - Build:
npm run build
MIT License - see LICENSE file for details.
Enjoy effortless telemetry! 🚀