Skip to main content

Overview

Returns an async function that creates a direct (1:1) conversation with a given user. If a direct conversation between the two users already exists on the server, it is returned rather than creating a duplicate. The conversation is also stored in Redux state.
Requires ChatProvider in the component tree.

Usage Example

Parameters

The hook returns a function. That function accepts:
userId
string
required
The ID of the user to start a conversation with.

Returns

Conversation
Conversation
The created or retrieved direct Conversation.

Notes