> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privacyboost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Session storage

# Session Storage

This guide covers session persistence so users don't need to re-authenticate on every visit using the Privacy Boost React SDK. For the conceptual overview, see [Key Management](/sdk/concepts/key-management).

## Built-In Persistence

Configure persistence in the provider:

```tsx theme={null}
<PrivacyBoostProvider
  config={{
    appId: 'your-app-id',
    serverUrl: 'https://...',
    persistence: {
      storage: 'localStorage',
      unlock: 'pin',
    },
  }}
>
  <App />
</PrivacyBoostProvider>
```

With persistence enabled, returning users don't see wallet popups — the SDK loads stored keys.

## Logout

| Method           | What it does                                | Next login                      |
| ---------------- | ------------------------------------------- | ------------------------------- |
| `clearSession()` | Clears auth token, keeps keys in memory     | Fast — no wallet popups         |
| `logout()`       | Clears everything (keys, token, connection) | Full re-auth with wallet popups |

```tsx theme={null}
import { useAuth } from '@sunnyside-io/privacy-boost-react';

function LogoutButtons() {
  const { clearSession, logout } = useAuth();

  return (
    <div>
      <button onClick={clearSession}>Switch Account</button>
      <button onClick={logout}>Full Logout</button>
    </div>
  );
}
```

## Next Steps

* [Wallet Integration](./wallet-integration)
* [Error Handling](./error-handling)
* [Key Management](/sdk/concepts/key-management)
