Privacy & Utilities
Helper utilities for privacy, masking, and SDK configuration
Privacy & Utilities
Ensora provides utilities for privacy compliance, data masking, and SDK introspection.
Session Sampling
Control what fraction of sessions are recorded to manage data volume:
<EnsoraProvider
apiKey="your_api_key"
projectId="your_project_id"
sessionSampleRate={0.5} // Record 50% of sessions
>
<Stack />
</EnsoraProvider>Disabling Tracking
Disable all tracking for development builds or opted-out users:
const isDev = process.env.NODE_ENV === 'development';
<EnsoraProvider
apiKey="your_api_key"
projectId="your_project_id"
disabled={isDev}
>
<Stack />
</EnsoraProvider>User Opt-Out
Respect user privacy preferences at runtime:
import { identify, track } from '@ensora/react-native';
async function handleOptOut(userId: string) {
// Track opt-out event before disabling
track('privacy_opt_out', { user_id: userId });
// Store preference in your own state
await AsyncStorage.setItem('analyticsOptOut', 'true');
}Data Masking
Configure masking rules in the dashboard under Settings → Privacy. Masking rules redact matched text from session recordings before data leaves the device.
Common masking patterns:
- Credit card numbers
- Email addresses
- Phone numbers
- Custom regex patterns
GDPR Deletion
Submit user data deletion requests from the dashboard under Settings → Data Requests. Deletion cascades across all sessions, events, heatmap data, and error logs for the specified user.
SDK Introspection
Check SDK Version
import { version } from '@ensora/react-native/package.json';
console.log(version);Environment Detection
import Constants from 'expo-constants';
const isProduction = Constants.expoConfig?.extra?.env === 'production';
<EnsoraProvider
apiKey="your_api_key"
projectId="your_project_id"
disabled={!isProduction}
>
<Stack />
</EnsoraProvider>Next Steps
- Usage — Configure touch capture and custom events
- API Reference — Complete SDK reference
Last updated on