Actions Library
- Turnkey
- Embed-SDK React
- Embed-SDK Web
Provides methods to execute specific actions like Muting / Unmuting a user and Joining / Creating a Room.
You can access them under the customization-api
module as a named export.
useCreateRoom(): createMeeting
Returns an asynchronous function to create a room with the given options.
- turnkey
- react-sdk
- web-sdk
import { useCreateRoom } from "customization-api";
...
const createMeeting = useCreateRoom();
...
await createMeeting(/*roomTitle:*/ 'My Room', /*enablePSTN?:*/ false, /*isSeperateHostLink?:*/ false );
import { useCreateRoom } from "@appbuilder/react";
...
const createMeeting = useCreateRoom();
...
await createMeeting(/*roomTitle:*/ 'My Room', /*enablePSTN?:*/ false, /*isSeperateHostLink?:*/ false );
import { useCreateRoom } from "@appbuilder/web";
...
const createMeeting = useCreateRoom();
...
await createMeeting(/*roomTitle:*/ 'My Room', /*enablePSTN?:*/ false, /*isSeperateHostLink?:*/ false );
Returns:
useJoinRoom(): joinRoom
Returns an asynchronous function to join a room with the given phrase.
- turnkey
- react-sdk
- web-sdk
import { useJoinRoom } from "customization-api";
...
const joinRoom = useJoinRoom();
...
await joinRoom(/*roomId:*/ 12342139812);
import { useJoinRoom } from "@appbuilder/react";
...
const joinRoom = useJoinRoom();
...
await joinRoom(/*roomId:*/ 12342139812);
import { useJoinRoom } from "@appbuilder/web";
...
const joinRoom = useJoinRoom();
...
await joinRoom(/*roomId:*/ 12342139812);
Returns:
useMuteToggleLocal(): muteToggleLocal
Returns an asynchronous function to toggle muted state of the given track type for the local user.
- turnkey
- react-sdk
- web-sdk
import { useMuteToggleLocal, MUTE_LOCAL_TYPE } from "customization-api";
...
const muteToggleLocal = useMuteToggleLocal();
...
muteToggleLocal( MUTE_LOCAL_TYPE.audio ); // toggle local user's audio mute state
import { useMuteToggleLocal, MUTE_LOCAL_TYPE } from "@appbuilder/react";
...
const muteToggleLocal = useMuteToggleLocal();
...
muteToggleLocal( MUTE_LOCAL_TYPE.audio ); // toggle local user's audio mute state
import { useMuteToggleLocal, MUTE_LOCAL_TYPE } from "@appbuilder/web";
...
const muteToggleLocal = useMuteToggleLocal();
...
muteToggleLocal( MUTE_LOCAL_TYPE.audio ); // toggle local user's audio mute state
Returns:
muteToggleLocal(type: MUTE_LOCAL_TYPE): Promise<void>
useRemoteMute(): muteToggleRemote
Returns an asynchronous function to toggle muted state of the given track type for a remote user with the given uid or if no uid provided, mutes everyone else in the room.
- turnkey
- react-sdk
- web-sdk
import { useRemoteMute, MUTE_REMOTE_TYPE } from "customization-api";
...
const muteToggleRemote = useRemoteMute();
...
muteToggleRemote( MUTE_REMOTE_TYPE.audio, 123457 ); // toggle uid:123457 user's audio mute state
import { useRemoteMute, MUTE_REMOTE_TYPE } from "@appbuilder/react";
...
const muteToggleRemote = useRemoteMute();
...
muteToggleRemote( MUTE_REMOTE_TYPE.audio, 123457 ); // toggle uid:123457 user's audio mute state
import { useRemoteMute, MUTE_REMOTE_TYPE } from "@appbuilder/web";
...
const muteToggleRemote = useRemoteMute();
...
muteToggleRemote( MUTE_REMOTE_TYPE.audio, 123457 ); // toggle uid:123457 user's audio mute state
Returns:
muteToggleLocal(type: MUTE_REMOTE_TYPE, uid?: UidType ): Promise<void>
useRemoteEndCall(): remoteEndCall
Returns a function to end the call for a remote user with the given uid.
- turnkey
- react-sdk
- web-sdk
import { useRemoteEndCall } from "customization-api";
...
const remoteEndCall = useRemoteEndCall();
...
remoteEndCall( 123457 ); // end uid:123457 user's call
import { useRemoteEndCall } from "@appbuilder/react";
...
const remoteEndCall = useRemoteEndCall();
...
remoteEndCall( 123457 ); // end uid:123457 user's call
import { useRemoteEndCall } from "@appbuilder/web";
...
const remoteEndCall = useRemoteEndCall();
...
remoteEndCall( 123457 ); // end uid:123457 user's call
Returns:
remoteEndCall(uid: UidType): void
useEndCall(): endCall
Returns a function to end the call for a local user.
- turnkey
- react-sdk
- web-sdk
import { useEndCall } from "customization-api";
...
const endCall = useEndCall();
...
endCall(); // end the call for local user
import { useEndCall } from "@appbuilder/react";
...
const endCall = useEndCall();
...
endCall(); // end the call for local user
import { useEndCall } from "@appbuilder/web";
...
const endCall = useEndCall();
...
endCall(); // end the call for local user
Returns:
useLocalAudio(): localAudio
Returns a object that contains enableAudioButton / disableAudioButton / getLocalAudioStream /getRemoteAudioStream / getLocalScreenshareAudioStream functions to access local/remote/screenshare audio stream and control UI button state
- turnkey
- react-sdk
- web-sdk
import { useLocalAudio } from "customization-api";
...
const {enableAudioButton, disableAudioButton, getLocalAudioStream, getRemoteAudioStream, getLocalScreenshareAudioStream} = useLocalAudio();
...
enableAudioButton(); // enable audio button
disableAudioButton(); // disable audio button
getLocalAudioStream(): // get local audio stream
getRemoteAudioSteam(123456); //get remote audio stream by uid
getLocalScreenshareAudioStream(): //get local screenshare audio stream
import { useLocalAudio } from "@appbuilder/react";
...
const {enableAudioButton, disableAudioButton, getLocalAudioStream, getRemoteAudioStream, getLocalScreenshareAudioStream} = useLocalAudio();
...
enableAudioButton(); // enable audio button
disableAudioButton(); // disable audio button
getLocalAudioStream(): // get local audio stream
getRemoteAudioSteam(123456); //get remote audio stream by uid
getLocalScreenshareAudioStream(): //get local screenshare audio stream
import { useLocalAudio } from "@appbuilder/web";
...
const {enableAudioButton, disableAudioButton, getLocalAudioStream, getRemoteAudioStream, getLocalScreenshareAudioStream} = useLocalAudio();
...
enableAudioButton(); // enable audio button
disableAudioButton(); // disable audio button
getLocalAudioStream(): // get local audio stream
getRemoteAudioSteam(123456); //get remote audio stream by uid
getLocalScreenshareAudioStream(): //get local screenshare audio stream
Returns:
useLocalVideo(): localVideo
Returns a object that contains enableVideoButton / disableVideoButton / getLocalVideoStream /getRemoteVideoStream / getLocalScreenshareVideoStream functions to access local/remote/screenshare video streams and control UI button state
- turnkey
- react-sdk
- web-sdk
import { useLocalVideo } from "customization-api";
...
const {enableVideoButton, disableVideoButton, getLocalVideoStream, getRemoteVideoStream, getLocalScreenshareVideoStream} = useLocalVideo();
...
enableVideoButton(); // enable video button
disableVideoButton(); // disable video button
getLocalVideoStream(); // to get local user video stream
getRemoteVideoStream(123456); // to get remote user video steam by uid
getLocalScreenshareVideoStream() // to get local user screenshare video stream
import { useLocalVideo } from "@appbuilder/react";
...
const {enableVideoButton, disableVideoButton, getLocalVideoStream, getRemoteVideoStream, getLocalScreenshareVideoStream} = useLocalVideo();
...
enableVideoButton(); // enable video button
disableVideoButton(); // disable video button
getLocalVideoStream(); // to get local user video stream
getRemoteVideoStream(123456); // to get remote user video steam by uid
getLocalScreenshareVideoStream() // to get local user screenshare video stream
import { useLocalVideo } from "@appbuilder/web";
...
const {enableVideoButton, disableVideoButton, getLocalVideoStream, getRemoteVideoStream, getLocalScreenshareVideoStream} = useLocalVideo();
...
enableVideoButton(); // enable video button
disableVideoButton(); // disable video button
getLocalVideoStream(); // to get local user video stream
getRemoteVideoStream(123456); // to get remote user video steam by uid
getLocalScreenshareVideoStream() // to get local user screenshare video stream
Returns:
useSpeechToText(): useSpeechToText
Returns a object that contains function and state data to manage the speech to text operation like start/stop/change language/get speaker name/download transcript etc
- turnkey
- react-sdk
- web-sdk
import { useSpeechToText } from "customization-api";
...
const { isSpeechToTextOn, startSpeechToText, stopSpeechToText, changeSpeakingLanguage, downloadTranscript, getActiveSpeakerName, getPrevSpeakerName, showTranscriptPanel, showCaptionPanel, transcriptData, captionData } = useSpeechToText();
...
isSpeechToTextOn; // to indicate whether Speech to text on/off
startSpeechToText(); // to start the speech to text
stopSpeechToText(); // to stop the speech to text
changeSpeakingLanguage(['en-US']); // to change the speech to text language
downloadTranscript(); // to download transcript data
getActiveSpeakerName(); // to get active speaker name
getPrevSpeakerName(); // to get prev speaker name
showTranscriptPanel(); // to show/hide transcript panel
showCaptionPanel(); //to show/hide caption panel
transcriptData // list of transcript data
captionData // last two speaker data
import { useSpeechToText } from "@appbuilder/react";
...
const { isSpeechToTextOn, startSpeechToText, stopSpeechToText, changeSpeakingLanguage, downloadTranscript, getActiveSpeakerName, getPrevSpeakerName, showTranscriptPanel, showCaptionPanel, transcriptData, captionData } = useSpeechToText();
...
isSpeechToTextOn; // to indicate whether Speech to text on/off
startSpeechToText(); // to start the speech to text
stopSpeechToText(); // to stop the speech to text
changeSpeakingLanguage(['en-US']); // to change the speech to text language
downloadTranscript(); // to download transcript data
getActiveSpeakerName(); // to get active speaker name
getPrevSpeakerName(); // to get prev speaker name
showTranscriptPanel(); // to show/hide transcript panel
showCaptionPanel(); //to show/hide caption panel
transcriptData // list of transcript data
captionData // last two speaker data
import { useSpeechToText } from "@appbuilder/web";
...
const { isSpeechToTextOn, startSpeechToText, stopSpeechToText, changeSpeakingLanguage, downloadTranscript, getActiveSpeakerName, getPrevSpeakerName, showTranscriptPanel, showCaptionPanel, transcriptData, captionData } = useSpeechToText();
...
isSpeechToTextOn; // to indicate whether Speech to text on/off
startSpeechToText(); // to start the speech to text
stopSpeechToText(); // to stop the speech to text
changeSpeakingLanguage(['en-US']); // to change the speech to text language
downloadTranscript(); // to download transcript data
getActiveSpeakerName(); // to get active speaker name
getPrevSpeakerName(); // to get prev speaker name
showTranscriptPanel(); // to show/hide transcript panel
showCaptionPanel(); //to show/hide caption panel
transcriptData // list of transcript data
captionData // last two speaker data
Returns:
startSpeechToText(): void
stopSpeechToText(): void
changeSpeakingLanguage(language: LanguageType[]): void
downloadTranscript(): void
getActiveSpeakerName(): string
getPrevSpeakerName(): string
showTranscriptPanel(): void
showCaptionPanel(): void
transcriptData: object
captionData: object
TYPES:
Name | Value |
---|---|
audio | 0 |
video | 1 |
- turnkey
- react-sdk
- web-sdk
import { MUTE_LOCAL_TYPE } from "customization-api";
import { MUTE_LOCAL_TYPE } from "@appbuilder/react";
import { MUTE_LOCAL_TYPE } from "@appbuilder/web";
Name | Value |
---|---|
audio | 0 |
video | 1 |
- turnkey
- react-sdk
- web-sdk
import { MUTE_REMOTE_TYPE } from "customization-api";
import { MUTE_REMOTE_TYPE } from "@appbuilder/react";
import { MUTE_REMOTE_TYPE } from "@appbuilder/web";
"" | "en-US" | "hi-IN" | "zh-CN" | "zh-HK" | "fr-FR" | "de-DE" | "ko-KR" | "en-IN" | "ar" | "ja-JP" | "pt-PT" | "es-ES" | "it-IT" | "id-ID"
- turnkey
- react-sdk
- web-sdk
import { LanguageType } from "customization-api";
import { LanguageType } from "@appbuilder/react";
import { LanguageType } from "@appbuilder/web";