Utility Library
- Turnkey
- Embed-SDK React
- Embed-SDK Web
Provides utility hooks and functions to perform app builder specific tasks easily.
- turnkey
- react-sdk
- web-sdk
You can access them under the customization-api
module as a named export.
You can access them under the @appbuilder/react
module as a named export.
You can access them under the @appbuilder/web
module as a named export.
useIsVideoEnabled(): isVideoEnabled
Returns a function that checks the video state for a given uid and returns true/false
- turnkey
- react-sdk
- web-sdk
import { useIsVideoEnabled } from "customization-api";
...
const isVideoEnabled = useIsVideoEnabled();
...
if (isVideoEnabled( 123457 )) {
// if user video enabled
} else {
// if user video disabled
}
import { useIsVideoEnabled } from "@appbuilder/react";
...
const isVideoEnabled = useIsVideoEnabled();
...
if (isVideoEnabled( 123457 )) {
// if user video enabled
} else {
// if user video disabled
}
import { useIsVideoEnabled } from "@appbuilder/web";
...
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
- turnkey
- react-sdk
- web-sdk
import { useIsAudioEnabled } from "customization-api";
...
const isAudioEnabled = useIsAudioEnabled();
...
if (isAudioEnabled( 123457 )) {
// if user audio enabled
} else {
// if user audio disabled
}
import { useIsAudioEnabled } from "@appbuilder/react";
...
const isAudioEnabled = useIsAudioEnabled();
...
if (isAudioEnabled( 123457 )) {
// if user audio enabled
} else {
// if user audio disabled
}
import { useIsAudioEnabled } from "@appbuilder/web";
...
const isAudioEnabled = useIsAudioEnabled();
...
if (isAudioEnabled( 123457 )) {
// if user audio enabled
} else {
// if user audio disabled
}
Returns:
isAudioEnabled(uid: UidType): boolean
useLocalUid(): UidType
Returns the local user's uid.
- turnkey
- react-sdk
- web-sdk
import { useLocalUid } from "customization-api";
...
const localUid = useLocalUid();
import { useLocalUid } from "@appbuilder/react";
...
const localUid = useLocalUid();
import { useLocalUid } from "@appbuilder/web";
...
const localUid = useLocalUid();
getCustomRoute(routeName:string): getCustomRoute
Returns the custom route path
- turnkey
- react-sdk
- web-sdk
import { getCustomRoute } from "customization-api";
...
const customRouteToRedirect = getCustomRoute('custom-page');
import { getCustomRoute } from "@appbuilder/react";
...
const customRouteToRedirect = getCustomRoute('custom-page');
import { getCustomRoute } from "@appbuilder/web";
...
const customRouteToRedirect = getCustomRoute('custom-page');
useIsHost(): isHost
Returns a function that checks whether the given uid is a host and returns true/false
- turnkey
- react-sdk
- web-sdk
import { useIsHost } from "customization-api";
...
const isHost = useIsHost();
...
if (isHost( 123457 )) {
// if user is host
} else {
// if user is not host
}
import { useIsHost } from "@appbuilder/react";
...
const isHost = useIsHost();
...
if (isHost( 123457 )) {
// if user is host
} else {
// if user is not host
}
import { useIsHost } from "@appbuilder/web";
...
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
- turnkey
- react-sdk
- web-sdk
import { useIsAttendee } from "customization-api";
...
const isAttendee = useIsAttendee();
...
if (isAttendee( 123457 )) {
// if user is attendee
} else {
// if user is not attendee
}
import { useIsAttendee } from "@appbuilder/react";
...
const isAttendee = useIsAttendee();
...
if (isAttendee( 123457 )) {
// if user is attendee
} else {
// if user is not attendee
}
import { useIsAttendee } from "@appbuilder/web";
...
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
- turnkey
- react-sdk
- web-sdk
import { useIsPSTN } from "customization-api";
...
const isPSTN = isPSTN();
...
if (isPSTN( 123457 )) {
// if user joined via pstn
} else {
// if user did not join via pstn
}
import { useIsPSTN } from "@appbuilder/react";
...
const isPSTN = isPSTN();
...
if (isPSTN( 123457 )) {
// if user joined via pstn
} else {
// if user did not join via pstn
}
import { useIsPSTN } from "@appbuilder/web";
...
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.
- turnkey
- react-sdk
- web-sdk
import { useHistory } from "customization-api";
import { useHistory } from "@appbuilder/react";
import { useHistory } from "@appbuilder/web";
useParams: useParamsHook
Returns the navigation parameters passed via the url/path.
- turnkey
- react-sdk
- web-sdk
import { useParams } from "customization-api";
import { useParams } from "@appbuilder/react";
import { useParams } from "@appbuilder/web";
isWeb(): boolean
Checks whether the application is running as a web app and returns true/false.
- turnkey
- react-sdk
- web-sdk
import { isWeb } from "customization-api";
...
if (isWeb()) {
// if running as a web application
} else {
// if not running as a web application
}
import { isWeb } from "@appbuilder/react";
...
if (isWeb()) {
// if running as a web application
} else {
// if not running as a web application
}
import { isWeb } from "@appbuilder/web";
...
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.
- turnkey
- react-sdk
- web-sdk
import { isIOS } from "customization-api";
...
if (isIOS()) {
// if running as an ios application
} else {
// if not running as an ios application
}
import { isIOS } from "@appbuilder/react";
...
if (isIOS()) {
// if running as an ios application
} else {
// if not running as an ios application
}
import { isIOS } from "@appbuilder/web";
...
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.
- turnkey
- react-sdk
- web-sdk
import { isAndroid } from "customization-api";
...
if (isAndroid()) {
// if running as an android application
} else {
// if not running as an android application
}
import { isAndroid } from "@appbuilder/react";
...
if (isAndroid()) {
// if running as an android application
} else {
// if not running as an android application
}
import { isAndroid } from "@appbuilder/web";
...
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.
- turnkey
- react-sdk
- web-sdk
import { isDesktop } from "customization-api";
...
if (isDesktop()) {
// if running as an electron desktop application
} else {
// if not running as an electron desktop application
}
import { isDesktop } from "@appbuilder/react";
...
if (isDesktop()) {
// if running as an electron desktop application
} else {
// if not running as an electron desktop application
}
import { isDesktop } from "@appbuilder/web";
...
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.
- turnkey
- react-sdk
- web-sdk
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.
}
import { isMobileOrTablet } from "@appbuilder/react";
...
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.
}
import { isMobileOrTablet } from "@appbuilder/web";
...
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.
}