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

# Twilio Video

> Add a native Twilio Video chat interface to your app and join video call rooms from your website with the JavaScript Bridge.

Add a native Twilio Video chat interface to your app. It gives your users an integrated video chat experience that performs better than a web-based client.

## Implementation guide

To join a video call, define a callback function in JavaScript, for example:

```javascript JavaScript theme={null}
function twilio_callback(data) { 
    if (data.error) {
        console.log('Twilio Error: ' + data.error);
    } else if (data.status) {
        console.log('Twilio Status: ' + data.status);
    }
}
```

Then, run the following JavaScript function, passing in the name of your callback function along with the other parameters `displayName`, `token`, and `identity`.

Median JavaScript Bridge

```javascript JavaScript theme={null}
// This command returns a promise if 'callback' is passed
median.twilio.video.join({'displayName': 'room', 'token': 'token', 'identity': 'identity', 'callback': twilio_callback});
```

Details of the query parameters:

* `displayName`: The name of the video call room to join.
* `identity`: The name that will be shown on the video call room for the user joining the room.
* `token`: The Access Token received from Twilio after authenticating with Twilio. For more information about how to obtain the access token: [Twilio API: Access Tokens ](https://www.twilio.com/docs/iam/access-tokens)

> [!TIP]
>
> **Promises**
>
> Some JavaScript Bridge commands return promises. They are usually declared as such
> through a comment to help you identify them. See
> [promises in the JavaScript Bridge](https://docs.median.co/docs/javascript-bridge.md#promises).


## Related topics

- [Media](https://docs.median.co/docs/media.md)
- [Integrations](https://docs.median.co/docs/integrations.md)
- [WebRTC audio & video](https://docs.median.co/docs/web-rtc.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.