Error Tracking
Capture and investigate unhandled errors with session context
Error Tracking
Ensora automatically captures unhandled JS exceptions and links them to the active session so you can watch the exact replay leading up to a crash.
Automatic Capture
No configuration needed. Wrap your app with EnsoraProvider and all unhandled errors are captured automatically.
import { EnsoraProvider } from '@ensora/react-native';
export default function RootLayout() {
return (
<EnsoraProvider apiKey="your_api_key" projectId="your_project_id">
<Stack />
</EnsoraProvider>
);
}Manual Error Tracking
Track caught errors with additional context:
import { track } from '@ensora/react-native';
async function loadUserData(userId: string) {
try {
const data = await fetchUser(userId);
return data;
} catch (error) {
track('error_caught', {
message: error.message,
screen: 'profile',
user_id: userId,
});
throw error;
}
}React Error Boundary
Use a React Error Boundary to catch render errors:
import { track } from '@ensora/react-native';
import React from 'react';
export class ErrorBoundary extends React.Component {
componentDidCatch(error: Error, info: React.ErrorInfo) {
track('render_error', {
message: error.message,
component_stack: info.componentStack,
});
}
render() {
if (this.state.hasError) {
return <FallbackUI />;
}
return this.props.children;
}
}Error Event Schema
Each captured error includes:
{
"event": "error",
"session_id": "uuid",
"timestamp": "2026-01-01T00:00:00Z",
"message": "TypeError: Cannot read property 'id' of undefined",
"stack": "at ProfileScreen (/app/profile.tsx:42:10)\n...",
"pathname": "/profile/123"
}Viewing Errors in the Dashboard
From the Sessions tab, filter sessions by Has errors to see affected recordings. Click any session to replay events and jump directly to the moment of the error.
When to Use Manual Tracking
- Caught exceptions in try-catch blocks
- API call failures with response context
- Validation errors with form field context
- Business logic errors distinct from crashes
Next Steps
- Custom Events — Track additional context alongside errors
- Session Replay — Watch sessions that contain errors
- API Reference — Complete error tracking API
Last updated on