api/javascript/telnyx-video-javascript/SKILL.md
Create and manage video rooms for real-time video communication and conferencing. This skill provides JavaScript SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-video-javascriptInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
npm install telnyx
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
All examples below assume client is already initialized as shown above.
GET /room_compositions
// Automatically fetches more pages as needed.
for await (const roomComposition of client.roomCompositions.list()) {
console.log(roomComposition.id);
}
Asynchronously create a room composition.
POST /room_compositions
const roomComposition = await client.roomCompositions.create();
console.log(roomComposition.data);
GET /room_compositions/{room_composition_id}
const roomComposition = await client.roomCompositions.retrieve(
'5219b3af-87c6-4c08-9b58-5a533d893e21',
);
console.log(roomComposition.data);
Synchronously delete a room composition.
DELETE /room_compositions/{room_composition_id}
await client.roomCompositions.delete('5219b3af-87c6-4c08-9b58-5a533d893e21');
GET /room_participants
// Automatically fetches more pages as needed.
for await (const roomParticipant of client.roomParticipants.list()) {
console.log(roomParticipant.id);
}
GET /room_participants/{room_participant_id}
const roomParticipant = await client.roomParticipants.retrieve(
'0ccc7b54-4df3-4bca-a65a-3da1ecc777f0',
);
console.log(roomParticipant.data);
GET /room_recordings
// Automatically fetches more pages as needed.
for await (const roomRecordingListResponse of client.roomRecordings.list()) {
console.log(roomRecordingListResponse.id);
}
DELETE /room_recordings
const response = await client.roomRecordings.deleteBulk();
console.log(response.data);
GET /room_recordings/{room_recording_id}
const roomRecording = await client.roomRecordings.retrieve('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(roomRecording.data);
Synchronously delete a Room Recording.
DELETE /room_recordings/{room_recording_id}
await client.roomRecordings.delete('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
GET /room_sessions
// Automatically fetches more pages as needed.
for await (const roomSession of client.rooms.sessions.list0()) {
console.log(roomSession.id);
}
GET /room_sessions/{room_session_id}
const session = await client.rooms.sessions.retrieve('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(session.data);
Note: this will also kick all participants currently present in the room
POST /room_sessions/{room_session_id}/actions/end
const response = await client.rooms.sessions.actions.end('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(response.data);
POST /room_sessions/{room_session_id}/actions/kick
const response = await client.rooms.sessions.actions.kick('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(response.data);
POST /room_sessions/{room_session_id}/actions/mute
const response = await client.rooms.sessions.actions.mute('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(response.data);
POST /room_sessions/{room_session_id}/actions/unmute
const response = await client.rooms.sessions.actions.unmute('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(response.data);
GET /room_sessions/{room_session_id}/participants
// Automatically fetches more pages as needed.
for await (const roomParticipant of client.rooms.sessions.retrieveParticipants(
'0ccc7b54-4df3-4bca-a65a-3da1ecc777f0',
)) {
console.log(roomParticipant.id);
}
GET /rooms
// Automatically fetches more pages as needed.
for await (const room of client.rooms.list()) {
console.log(room.id);
}
Synchronously create a Room.
POST /rooms
const room = await client.rooms.create();
console.log(room.data);
GET /rooms/{room_id}
const room = await client.rooms.retrieve('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(room.data);
Synchronously update a Room.
PATCH /rooms/{room_id}
const room = await client.rooms.update('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
console.log(room.data);
Synchronously delete a Room.
DELETE /rooms/{room_id}
await client.rooms.delete('0ccc7b54-4df3-4bca-a65a-3da1ecc777f0');
Synchronously create an Client Token to join a Room.
POST /rooms/{room_id}/actions/generate_join_client_token
const response = await client.rooms.actions.generateJoinClientToken(
'0ccc7b54-4df3-4bca-a65a-3da1ecc777f0',
);
console.log(response.data);
Synchronously refresh an Client Token to join a Room.
POST /rooms/{room_id}/actions/refresh_client_token — Required: refresh_token
const response = await client.rooms.actions.refreshClientToken(
'0ccc7b54-4df3-4bca-a65a-3da1ecc777f0',
{
refresh_token:
'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ0ZWxueXhfdGVsZXBob255IiwiZXhwIjoxNTkwMDEwMTQzLCJpYXQiOjE1ODc1OTA5NDMsImlzcyI6InRlbG55eF90ZWxlcGhvbnkiLCJqdGkiOiJiOGM3NDgzNy1kODllLTRhNjUtOWNmMi0zNGM3YTZmYTYwYzgiLCJuYmYiOjE1ODc1OTA5NDIsInN1YiI6IjVjN2FjN2QwLWRiNjUtNGYxMS05OGUxLWVlYzBkMWQ1YzZhZSIsInRlbF90b2tlbiI6InJqX1pra1pVT1pNeFpPZk9tTHBFVUIzc2lVN3U2UmpaRmVNOXMtZ2JfeENSNTZXRktGQUppTXlGMlQ2Q0JSbWxoX1N5MGlfbGZ5VDlBSThzRWlmOE1USUlzenl6U2xfYURuRzQ4YU81MHlhSEd1UlNZYlViU1ltOVdJaVEwZz09IiwidHlwIjoiYWNjZXNzIn0.gNEwzTow5MLLPLQENytca7pUN79PmPj6FyqZWW06ZeEmesxYpwKh0xRtA0TzLh6CDYIRHrI8seofOO0YFGDhpQ',
},
);
console.log(response.data);
GET /rooms/{room_id}/sessions
// Automatically fetches more pages as needed.
for await (const roomSession of client.rooms.sessions.list1(
'0ccc7b54-4df3-4bca-a65a-3da1ecc777f0',
)) {
console.log(roomSession.id);
}
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.