LiveKit docs › Hooks › usePersistentUserChoices

---

# usePersistentUserChoices

> ℹ️ **Note**
> 
> This feature is experimental and may change or be removed based on developer feedback and real-world usage.

A hook that provides access to user choices stored in local storage, such as selected media devices and their current state (on or off), as well as the user name.

## Import

```typescript
import { usePersistentUserChoices } from "@livekit/components-react";

```

## Properties

- **`options.defaults`** _(Partial<LocalUserChoices>)_ (optional): The default value to use if reading from local storage returns no results or fails.

- **`options.preventLoad`** _(boolean)_ (optional): Whether to prevent loading user choices from persistent storage and use `defaults` instead.

- **`options.preventSave`** _(boolean)_ (optional): Whether to prevent saving to persistent storage.

## Returns

```typescript
{
    userChoices: LocalUserChoices;
    saveAudioInputEnabled: (isEnabled: boolean) => void;
    saveVideoInputEnabled: (isEnabled: boolean) => void;
    saveAudioInputDeviceId: (deviceId: string) => void;
    saveVideoInputDeviceId: (deviceId: string) => void;
    saveUsername: (username: string) => void;
}

```

---

This document was rendered at 2026-06-07T11:32:48.501Z.
For the latest version of this document, see [https://docs.livekit.io/reference/components/react/hook/usepersistentuserchoices.md](https://docs.livekit.io/reference/components/react/hook/usepersistentuserchoices.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).