Skip to main content

Utility Library

Provides utility hooks and functions to perform app builder specific tasks easily.

You can access them under the customization-api module as a named export.


useIsVideoEnabled(): isVideoEnabled

Returns a function that checks the video state for a given uid and returns true/false

import { useIsVideoEnabled } from "customization-api";

...

const isVideoEnabled = useIsVideoEnabled();

...

if (isVideoEnabled( 123457 )) {
// if user video enabled
} else {
// if user video disabled
}

Returns:

isVideoEnabled(uid: UidType): boolean


useIsAudioEnabled(): isAudioEnabled

Returns a function that checks the audio state for a given uid and returns true/false

import { useIsAudioEnabled } from "customization-api";

...

const isAudioEnabled = useIsAudioEnabled();

...

if (isAudioEnabled( 123457 )) {
// if user audio enabled
} else {
// if user audio disabled
}

Returns:

isAudioEnabled(uid: UidType): boolean


useLocalUid(): UidType

Returns the loacal user's uid.

import { useLocalUid } from "customization-api";

...

const localUid = useLocalUid();


useIsHost(): isHost

Returns a function that checks whether the given uid is a host and returns true/false

import { useIsHost } from "customization-api";

...

const isHost = useIsHost();

...

if (isHost( 123457 )) {
// if user is host
} else {
// if user is not host
}

Returns:

isHost(uid: UidType ): boolean


useIsAttendee(): isAttendee

Returns a function that checks whether the given uid is an attendee and returns true/false

import { useIsAttendee } from "customization-api";

...

const isAttendee = useIsAttendee();

...

if (isAttendee( 123457 )) {
// if user is attendee
} else {
// if user is not attendee
}

Returns:

isAttendee(uid: UidType): boolean


useIsPSTN(): isPSTN

Returns a function that checks whether the given uid is a PSTN user and returns true/false

import { useIsPSTN } from "customization-api";

...

const isPSTN = isPSTN();

...

if (isPSTN( 123457 )) {
// if user joined via pstn
} else {
// if user did not join via pstn
}

Returns:

isPSTN(uid: UidType): boolean


useHistory: useHistoryHook

Returns the internal "react-router" instance's history object.

import { useHistory } from "customization-api";

useParams: useParamsHook

Returns the navigataion parameters passed via the url/path.

import { useParams } from "customization-api";

isWeb(): boolean

Checks whether the application is running as a web app and returns true/false.

import { isWeb } from "customization-api";

...

if (isWeb()) {
// if running as a web application
} else {
// if not running as a web application
}

isIOS(): boolean

Checks whether the application is running as an iOS app and returns true/false.

import { isIOS } from "customization-api";

...

if (isIOS()) {
// if running as an ios application
} else {
// if not running as an ios application
}

isAndroid(): boolean

Checks whether the application is running as an android app and returns true/false.

import { isAndroid } from "customization-api";

...

if (isAndroid()) {
// if running as an android application
} else {
// if not running as an android application
}

isDesktop(): boolean

Checks whether the application is running as an electron desktop app and returns true/false.

import { isDesktop } from "customization-api";

...

if (isDesktop()) {
// if running as an electron desktop application
} else {
// if not running as an electron desktop application
}

isMobileOrTablet(): boolean

Checks whether the application is running as a web application on a mobile or tablet device and returns true/false.

import { isMobileOrTablet } from "customization-api";

...

if (isMobileOrTablet()) {
// if running as a web application on a mobile or tablet device and returns true/false.
} else {
// if not running as a web application on a mobile or tablet device and returns true/false.
}