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 function which used to enable/disable local user audio button
- turnkey
- react-sdk
- web-sdk
import { useLocalAudio } from "customization-api";
...
const {enableAudioButton, disableAudioButton} = useLocalAudio();
...
enableAudioButton(); // enable audio button
disableAudioButton(); // disable audio button
import { useLocalAudio } from "@appbuilder/react";
...
const localAudio = useLocalAudio();
...
enableAudioButton(); // enable audio button
disableAudioButton(); // disable audio button
import { useLocalAudio } from "@appbuilder/web";
...
const {enableAudioButton,disableAudioButton} = useLocalAudio();
...
enableAudioButton(); // enable audio button
disableAudioButton(); // disable audio button
Returns:
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";