> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# setMemberState

* **setMemberState**(`params`): `Promise<void>`

Sets a state object for a member, for the specified channels. The previous state object will be completely replaced.

## Parameters

**`params`** `object` — required

Configuration object for setting member state

---

**`params.channels`** `string | string[]` — required

Channels for which to set the state.

---

**`params.memberId`** `string` — required

Id of the member to affect. If not provided, defaults to the current member.

---

**`params.state`** `Record<any, any toc={true}>` — required

The state to set. There are no requirements on the content of the state.

---

## Returns

`Promise<void>`

## Example

```js
await chatClient.setMemberState({
  channels: ["chan1", "chan2"],
  state: {
    online: true,
    typing: false,
  },
});
```