User accounts
v1.9.0Identify the account a tester is using when they report a bug.
tsx
import { BugScreen, type BugScreenUser } from '@bugscreen/react-native';
import { useEffect } from 'react';
// ready becomes true after configure() resolves.
function useBugScreenUser(user: BugScreenUser | null, ready: boolean) {
useEffect(() => {
if (!ready) return;
if (user) BugScreen.setUser({ id: user.id, role: user.role });
else BugScreen.clearUser();
}, [user, ready]);
}- Set the account after configuration and whenever authentication changes. Clear it on logout.
- Each setUser call replaces the whole account, including any optional fields.
- The role becomes a filterable label. ID and email stay in the issue body.
- Email is optional and is never collected automatically. Pass it only when you want a contact address in the tracker.