Third Party In-Chat Calling
Confused about "Third Party In-Chat Calling"?
Let us know how we can improve our documentation:
Stream applications can be configured to use external video providers such as 100ms and Agora. This makes it very easy to add in-chat-calling to your application without creating a server-side integration on your side.
Setting up your application with an external provider
Copied!Confused about "Setting up your application with an external provider"?
Let us know how we can improve our documentation:
First of all you need to setup Stream Chat with your video provider. At the moment Stream integrates directly with Agora and 100ms.
When you use one of these providers, you can initiate calls from chat without any server-side support on your side. The configuration can be done via Dashboard, CLI or API. You can find detailed information about each provider later in this document.
Initiating a call from Chat
Copied!Confused about "Initiating a call from Chat"?
Let us know how we can improve our documentation:
Chat users can initiate a call directly from a channel. To do this you need to use the Create Call endpoint.
The Create Call API call returns a call object and an authentication token. The call object contains the information needed for users to join the call to your provider. You can embed this information inside a message attachment, channel event or attach it to the channel.
Calls have two required parameter: id
and type
. Calls are unique based on their id
value, when a call with the same id is found we will re-use that one instead of returning an error or creating a new one. This is very convenient if you want to ensure that only one call exists for one channel. The type
field can be set to “video” or “audio”.
You can safely store the entire call object inside a message, in fact that’s the simplest way to integrate in-chat-calls.
Notifying users
Copied!Confused about "Notifying users"?
Let us know how we can improve our documentation:
There are several ways you can use to notify other users about the call:
You can send a message on the channel and include the
call
object inside an attachmentYou can store the
call
object inside the channelYou can send a custom event on the channel
In the last two cases the user(s) will receive an event which you can use to display the UI needed to join the call. Message attachments can be easily customized to show a call UI.
CreateCall API Endpoint
Copied!Confused about "CreateCall API Endpoint"?
Let us know how we can improve our documentation:
Body Parameters
Copied!name | type | description | default | optional |
---|---|---|---|---|
id | string | A unique identifier to assign to the call. The id is case-insensitive. Accepted characters are | ✓ | |
options | object | Additional options that are passed to the video provider. | Empty object | ✓ |
Response
Copied!Name | Type | Description |
---|---|---|
call | Call Object | |
token | string | The provider token needed to join the call for the user that created the call. |
agora_uid | float | The Agora uid needed to join the call for the requesting user. This field is only present when |
agora_app_id | string | The Agora app_id |
Call object
Copied!name | type | description |
---|---|---|
provider | string | The video provider used to host the call. This can be |
id | string | The unique identifier for the call. This ID is used to retrieve user tokens. |
agora | object | An object containing the information needed to identify and open the call using Agora SDK.
At the moment |
hms | object | An object containing the information needed to identify and open the call using 100ms SDK.
At the moment |
Join a call from Chat
Copied!Confused about "Join a call from Chat"?
Let us know how we can improve our documentation:
Users can join an existing call using the information stored inside a channel (eg. message attachment). Chat users can use the GetCallToken to obtain the authentication token for a call.
The authentication token is retrieved by using the id of the call as returned inside the call object by the Create Call endpoint.