Initialization

Introduction

The Client Library needs to be initialised using the APIs below before any other Client Library APIs can be used.

Functions

init()

Should be called once to init the library

getConnectReason()ConnectReason

Returns the reason the ui has been loaded

getTriggerEvent()Object

Returns the event that triggered the reloading of the ui after ui has been released

isRunningE2E()

Returns a boolean that indicates whether we are running in an e2e environment, or on local browser

uiReady()

Call this API once after application startup, when the ui is ready to accept keys/events

Typedefs

ConnectReason : Object

The reason the ui app has been loaded

init()

Should be called once to init the library.

Kind: global function
Example

import { init } from 'senza-sdk';
await init();

isRunningE2E()

Returns a boolean that indicates whether the app is running in an end-to-end environment or on local browser:

Kind: global function

uiReady()

Call this API once after application startup, when the UI is ready to accept keys/events.

Kind: global function

getConnectReason() ⇒ ConnectReason

Returns the reason the ui has been loaded.

Kind: global function

getTriggerEvent() ⇒ Object

Returns the event that triggered the reloading of the ui after ui has been released.

Kind: global function
Returns: Object - trigger event
Properties

NameTypeDescription
typestringthe type of the trigger event (e.g. keyPressEvent, videoPlaybackEvent)
dataobjectdata of the event, dependent on its type (e.g. keyPressEvent has data of keyValue)

ConnectReason : Object

The reason the ui app has been loaded.

Kind: global typedef
Properties

NameTypeDescription
UNKNOWNstring
INITIAL_CONNECTIONstringIndicates that ui app has been loaded for the first time
UI_RELEASEstringIndicates that ui app has been reloaded after ui release
UI_TERMINATIONstringIndicates that ui app has been reloaded due to ui termination
WEBRTC_ERRORstringIndicates that ui app has been reloaded due to webrtc error
UI_WATCHDOGstringIndicates that ui app has been reloaded due to ui watchdog not receiving ui frames

setTimezone(timezone)

Sets the timezone on the platform that runs the web application.

Kind: global

Param: string timezone - the timezone to set to. the format of the timezone is according to the standard TZ identifier (i.e America/Los_Angeles, Asia/Tokyo, Europe/Brussels). For a full list of TZ identifiers, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

Example

import { setTimezone } from 'senza-sdk';
setTimezone("Europe/London");

What’s Next