eventlog-rn
v0.3.5
Published
Functional, type-safe event logging SDK for React Native
Maintainers
Readme
eventlog-rn
Functional, type-safe event logging SDK for React Native
What is this?
eventlog-rn is a local-first activity tracker for React Native that helps you understand user behavior and debug issues by recording screens, actions, and errors.
It is designed to be safe, fast, and privacy-focused:
- 🏃♂️ Zero performance impact: Synchronous logging (<1ms) with batched writes.
- 💾 Unlimited storage: Uses MMKV to store thousands of events.
- 🌐 Network Logs: Auto-captures
fetchandXMLHttpRequest. - 🚨 Error Handling: Captures crashes, promise rejections, and React render errors.
- 🛡️ Privacy-first: Data stays on the device. you control when to export.
- 🧩 Type-safe: Built with strict TypeScript and result types for robust error handling.
This is not a cloud analytics platform. It is a tool for developers to capture local context and user journeys for debugging and support.
Documentation
Quick Start
1. Install
npm install eventlog-rn react-native-mmkv2. Initialize
import { eventLog } from 'eventlog-rn';
// 1. Initialize (call once at app start)
await eventLog.init(); // Network logging enabled by default!
// 2. Log events
eventLog.screen('HomeScreen');
eventLog.action('button_clicked', { buttonId: 'checkout' });
// 3. Export for debugging
const result = await eventLog.export({ mode: 'repro' });3. View logs (optional)
import { EventLogViewer, EventLogErrorBoundary } from 'eventlog-rn';
// Wrap app for error handling
<EventLogErrorBoundary>
<App />
<EventLogViewer />
</EventLogErrorBoundary>License
MIT
