# Expanded auth logging with automatic redaction

**Version:** v2.14.0

**Published:** June 12, 2026

The SDK now emits structured logs across the full authentication flow. Each log line is tagged with the relevant project and dataset (useful for apps that need to authenticate across many projects and datasets), and sensitive values are automatically redacted.

## Expanded auth logging

The SDK now logs key authentication events: login and callback, token set and clear, logout, token refresh, and current-user fetching.

Logging is off by default. Enable it without code changes using the `DEBUG` environment variable:

**sh**

```sh
DEBUG=sanity:auth sanity dev # or enable all Sanity namespaces DEBUG=sanity:* sanity dev
```

Or enable it programmatically with [configureLogging](https://reference.sanity.io/_sanity/sdk/index/configureLogging/):

**App.tsx**

```
configureLogging({ level: 'info', namespaces: ['auth'] })
```

Each log line includes the project ID, dataset, and instance. Tokens and secrets are automatically redacted.

