Skip to main content
Breadcrumbs are lightweight diagnostic events emitted as the Privy SDK progresses through key flows, such as session restoration and wallet creation. Register a breadcrumb handler to receive these events and forward them to your own analytics, logging, or observability tooling (e.g. Sentry, Datadog, Firebase).
Breadcrumbs are currently available on the Privy iOS and Android native SDKs only.
Breadcrumbs are for lightweight operational visibility, not full error reporting. Payloads never contain PII, and handlers must not throw or block, since they’re called synchronously on the emitting thread.

1. Register a breadcrumb handler

Implement the platform’s breadcrumb handler interface and pass it to your PrivyConfig when initializing the SDK.
breadcrumbHandler is optional. If it’s omitted, the SDK emits no breadcrumbs and there’s no performance cost.

2. Breadcrumb payload shape

Every breadcrumb exposes the same three fields, regardless of event type: receive(_:) is called synchronously on the thread that triggered the event. Keep handler implementations fast and non-blocking, and dispatch any expensive work (network calls, disk writes) to a background queue.

3. Available breadcrumb events

On iOS, data.error is a stable, non-sensitive error code (the PrivyError code hierarchy, or just the Swift type name for non-PrivyError types). On Android, data.error is currently the underlying exception’s message. Avoid logging Android data.error values to systems where raw exception messages shouldn’t be stored, and treat both as best-effort diagnostic strings rather than a stable enum.

4. Example: forwarding to Sentry

Because breadcrumbs carry no PII and are cheap to emit, it’s safe to register a handler in every build configuration, including production. Gate any verbose console logging (like the examples in step 1) behind a debug flag.