# PresenceList: setStatus() method

> The setStatus() method of the PresenceList interface sets the local player's presence status, which every connection sees.

The **`setStatus()`** method of the [`PresenceList`](/docs/client/presence-list) interface sets the local player's presence status, a small JSON value every connection in the room sees.

## Syntax

```ts
setStatus(status)
```

### Parameters

`status`
: Any JSON value of at most 1 KB as JSON, such as `{ typing: true }`, or `null` to clear it.

### Return value

None (`undefined`).

### Exceptions

`TypeError`
: Thrown if `status` can't be serialized as JSON.

`RangeError`
: Thrown if `status` is over 1 KB as JSON.

`Error`
: Thrown if the client has no presence entry yet, before it's first ready.

## Description

`setStatus()` is an owner write, like setting a writable field of an [`OwnedEntity`](/docs/client/owned-entity). It changes [`me.status`](/docs/client/presence-list/me) at once, without firing the [`change` event](/docs/client/presence-list/change-event), and the client sends it with its other owner writes: before a call or message, and otherwise at most once per tick in a room with ticks, or at once and then at most once per 16 ms in a room without ticks.

The status keeps a copy of the value, so changing your object afterwards changes nothing. Every other client sees the new status in a state update, and their `change` event fires for `status`.

The room has the last word. It can replace any player's status with [`Presence.set()`](/docs/room/presence/set), and when it changes this player's, the client gets a correction and `change` fires for `status`. A status is a claim from the player, so keep anything that decides the game out of it; the room's [`writes`](/docs/room/room-definition/writes) handlers don't run for it.

## Examples

### Showing who's typing

The client sets a typing flag while the chat box has text in it, and clears it when the message is sent.

```ts
// typing.ts
import { connect } from "@irtio/client";

const room = await connect("main");
let typing = false;

export function onInput(text: string): void {
  if (typing === (text !== "")) return;
  typing = text !== "";
  room.presence.setStatus({ typing });
}

export function onSend(message: string): void {
  room.send({ type: "chat", message });
  typing = false;
  room.presence.setStatus({ typing });
}
```

Setting the status only when the flag flips keeps the client from queueing a write on every keystroke.

## See also

- [`PresenceEntry`](/docs/client/presence-entry)
- [`Presence.set()`](/docs/room/presence/set), the room's side
- [Status](/docs/room/guides/presence#status)
