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

# setUserData()

> Sets arbitrary custom data on the local participant, visible to all other participants.

`setUserData(data)`

<Badge color="green">{"✓"} Prebuilt</Badge> <Badge color="green">{"✓"} Custom</Badge>

Associates arbitrary custom data with the local participant and syncs it to all other participants. The data is stored in the `userData` property of the local participant's [`DailyParticipant`](/reference/daily-js/types/daily-participant) object and replaces any previously set value.

A participant can only set their own `userData` — not another participant's.

<Note>
  Updates are rate limited. The local copy of `userData` is updated immediately, but propagation to other participants is throttled. All participants are guaranteed to converge on the same final value.
</Note>

## Parameters

<ParamField body="data" type="unknown" required>
  Any JSON-serializable value with a max payload size of 4KB. Pass `undefined` to remove `userData` from the participant object entirely.
</ParamField>

## Return value

Returns a `Promise` that resolves to `{ userData: unknown }` — the value that was set.

## Custom avatar in Daily Prebuilt

Setting an `avatar` key displays a custom image on the participant's muted tile and in the People tab. The URL must be publicly accessible.

```javascript theme={null}
call.setUserData({ avatar: 'https://example.com/avatar.jpg' });
```

<img src="https://mintcdn.com/daily-co/UZ5SeZfPxiPGRDvT/assets/prebuilt-custom-avatar.png?fit=max&auto=format&n=UZ5SeZfPxiPGRDvT&q=85&s=366d1363b8ad611cf167119ff0fee859" alt="Video call participant tile showing a custom avatar image" width="2140" height="1994" data-path="assets/prebuilt-custom-avatar.png" />

## Examples

### Custom application state

```javascript theme={null}
call.setUserData({ hasHandRaised: true });
```

### Reading userData

```javascript theme={null}
const local = call.participants()['local'];
console.log(local.userData);

const remote = call.participants()[participantSessionId];
console.log(remote.userData);
```

## See also

<CardGroup>
  <Card title="Types" icon="t" iconType="solid">
    * [DailyCallOptions: userData](/reference/daily-js/types/daily-call-options#param-user-data)
    * [DailyParticipant](/reference/daily-js/types/daily-participant)
  </Card>

  <Card title="Methods" icon="code" iconType="solid">
    * [participants()](/reference/daily-js/instance-methods/participants)
    * [setUserName()](/reference/daily-js/instance-methods/set-user-name)
  </Card>

  <Card title="Events" icon="bolt" iconType="solid">
    * [participant-updated](/reference/daily-js/events/participant-events#participant-updated)
  </Card>

  <Card title="Guides" icon="book-open" iconType="solid">
    * [Custom messages and shared data](/docs/daily-js/guides/custom-messages)
  </Card>
</CardGroup>
