Skip to main content
@capgo/capacitor-twilio-video Communication Open source

Twilio Video Capacitor plugin

Join Twilio Video rooms from Capacitor with native audio, camera, and room lifecycle events

Install

bun add @capgo/capacitor-twilio-video bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-twilio-video
  • pnpm add @capgo/capacitor-twilio-video
  • yarn add @capgo/capacitor-twilio-video

Guide

How to use Twilio Video in Capacitor

Using @capgo/capacitor-twilio-video

Capacitor API for joining Twilio Video rooms with a native in-app call surface.

Install

bun add @capgo/capacitor-twilio-video
bunx cap sync

bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.

Import

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

API at a glance

Method Description
login Store and validate a Twilio Video access token minted by your backend.
logout Clear the cached access token and leave the active room.
isLoggedIn Check whether a valid Twilio token is currently cached on the device.
joinRoom Join a Twilio room and present the plugin's native in-app call overlay.
leaveRoom Leave the current room if connected.
setMicrophoneEnabled Enable/disable local microphone publishing.
setCameraEnabled Enable/disable local camera publishing.
getCallStatus Return the current room name, media state, and participant count.
checkMicrophonePermission Check microphone permission state.
requestMicrophonePermission Request microphone permission.
checkCameraPermission Check camera permission state.
requestCameraPermission Request camera permission.

Examples

login()

Store and validate a Twilio Video access token minted by your backend.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

const result = await CapacitorTwilioVideo.login({ accessToken: 'access-token-123' });
console.log(result);

logout()

Clear the cached access token and leave the active room.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

const result = await CapacitorTwilioVideo.logout();
console.log(result);

isLoggedIn()

Check whether a valid Twilio token is currently cached on the device.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

const result = await CapacitorTwilioVideo.isLoggedIn();
// The result holds sensitive values: use it without logging it.

joinRoom()

Join a Twilio room and present the plugin's native in-app call overlay.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

const result = await CapacitorTwilioVideo.joinRoom({ roomName: 'room' });
console.log(result);

leaveRoom()

Leave the current room if connected.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

const result = await CapacitorTwilioVideo.leaveRoom();
console.log(result);

setMicrophoneEnabled()

Enable/disable local microphone publishing.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

const result = await CapacitorTwilioVideo.setMicrophoneEnabled({ enabled: true });
console.log(result);

The table above lists the 12 core methods. Listener and version helpers, and the full contract of each method, are documented in the GitHub repository.

Listen to events

addListener returns a handle. Call handle.remove() when the screen unmounts, or CapacitorTwilioVideo.removeAllListeners() to clear every listener.

Full reference

Keep going from Using @capgo/capacitor-twilio-video

If you are using Using @capgo/capacitor-twilio-video to plan native media and interface behavior, connect it with @capgo/capacitor-twilio-video for the implementation detail in @capgo/capacitor-twilio-video, Getting Started for the implementation detail in Getting Started, Using @capgo/capacitor-live-activities for the native capability in Using @capgo/capacitor-live-activities, @capgo/capacitor-live-activities for the implementation detail in @capgo/capacitor-live-activities, and Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player.

FAQ

Twilio Video plugin FAQ

How do I install the Twilio Video plugin in a Capacitor app?

Run "bun add @capgo/capacitor-twilio-video" (or "npm install @capgo/capacitor-twilio-video"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-twilio-video" in your app code.

Does @capgo/capacitor-twilio-video work with React, Vue and Angular?

Yes. Twilio Video is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-twilio-video support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-twilio-video free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-twilio-video/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Twilio Video without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Twilio Video changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo