Rate this page:

Client

Interface that provides API to connect and log in to the Voximplant Cloud.

Methods

addEventListener

Copy URL
addEventListener(eventName: 

ClientEvent.Disconnected

,
listener:

(event: ClientDisconnected) => void | Promise<void>

,
options:

ListenerOptions

):

void

Registers a handler for the specified event.

One event can have more than one handler; handlers are executed in order of their registration.

Parameters

Returns

  • type:

    void

connect

Copy URL
connect(options: 

ConnectionOptions

):

Promise<void>

Connects to the Voximplant Cloud.

Returns a promise that is resolved when the connection to the Voximplant Cloud is established.

Parameters

Returns

  • type:

    Promise<void>

Throws

disconnect

Copy URL
disconnect(): 

Promise<void>

Disconnects from the Voximplant Cloud.

Returns a promise that is resolved when the connection to the Voximplant Cloud is closed.

Returns

  • type:

    Promise<void>

login

Copy URL
login(options: 

PasswordLoginOptions

):

Promise<LoginResult>

Logs in a user with a password to the Voximplant Cloud.

Returns a promise that is resolved to a LoginResult object.

Parameters

Returns

Throws

loginAccessToken

Copy URL
loginAccessToken(options: 

AccessTokenLoginOptions

):

Promise<LoginResult>

Logs in a user with an access token to the Voximplant Cloud.

Returns a promise that is resolved to a LoginResult object.

Parameters

Returns

Throws

loginOneTimeKey

Copy URL
loginOneTimeKey(options: 

OneTimeKeyLoginOptions

):

Promise<LoginResult>

Logs in a user with a one-time key to the Voximplant Cloud.

Returns a promise that is resolved to a LoginResult object.

Parameters

Returns

Throws

refreshTokens

Copy URL
refreshTokens(options: 

RefreshTokenOptions

):

Promise<LoginTokens>

Performs a refresh of login tokens required for Client.loginAccessToken.

Returns a promise that is resolved to a LoginTokens object.

Parameters

Returns

Throws

removeEventListener

Copy URL
removeEventListener(eventName: 

ClientEvent.Disconnected

,
listener:

(event: ClientDisconnected) => void | Promise<void>

):

void

Removes a previously registered handler for the specified event.

Parameters

Returns

  • type:

    void

requestOneTimeKey

Copy URL
requestOneTimeKey(options: 

RequestOneTimeKeyOptions

):

Promise<string>

Generates a one-time login key to use in the automated login process.

For additional information please see the guide.

Returns a promise that is resolved to a string that represents the one-time key.

Parameters

Returns

  • type:

    Promise<string>

Throws

Props

state

Copy URL
state: 

ReadonlyWatchable<ClientState>

Watchable property that allows getting the current client state and observe its changes.