Custom data
v1.9.0Attach your own context to every bug report.
tsx
import { BugScreen } from '@bugscreen/react-native';
// Replace the whole map:
BugScreen.setCustomData({ env: 'staging', buildType: 'debug', userTier: 'pro' });
// Set or remove a single key:
BugScreen.setCustomDataValue('userId', 'abc-123');
BugScreen.removeCustomData('userId');
// Merge a map without replacing existing keys:
BugScreen.addCustomData({ plan: 'pro', region: 'eu' });
// Remove all custom data:
BugScreen.clearCustomData();- Use string values. Serialize objects yourself before adding them.
- setCustomData replaces the map; addCustomData merges it. Use removeCustomData to remove one key.
- Values are captured when the reporter opens. Replacing or clearing custom data leaves the user account intact.
For callers bypassing TypeScript, map methods drop null/undefined entries and convert other values to strings.
Keep secrets out of logs and custom data.