Skip to content

Getting Started

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Terminal window
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-twilio-video` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

Terminal window
bun add @capgo/capacitor-twilio-video
bunx cap sync
import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';

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);

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);

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.

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);

Leave the current room if connected.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.leaveRoom();
console.log(result);

Enable/disable local microphone publishing.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.setMicrophoneEnabled({ enabled: true });
console.log(result);

Enable/disable local camera publishing.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.setCameraEnabled({ enabled: true });
console.log(result);

Return the current room name, media state, and participant count.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.getCallStatus();
// The result holds sensitive values: use it without logging it.

Check microphone permission state.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.checkMicrophonePermission();
console.log(result);

Request microphone permission.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.requestMicrophonePermission();
console.log(result);

Check camera permission state.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.checkCameraPermission();
console.log(result);

Request camera permission.

import { CapacitorTwilioVideo } from '@capgo/capacitor-twilio-video';
const result = await CapacitorTwilioVideo.requestCameraPermission();
console.log(result);

This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.

If you are using Getting Started to plan native media and interface behavior, connect it with Using @capgo/capacitor-twilio-video for the native capability in Using @capgo/capacitor-twilio-video, 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, Using @capgo/capacitor-video-player for the native capability in Using @capgo/capacitor-video-player, and @capgo/capacitor-video-player for the implementation detail in @capgo/capacitor-video-player.