Rate this page:

Client

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

Methods

addEventListener

Copy URL

void

addEventListener(

ClientEvent.Disconnected

eventName,

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

listener,

ListenerOptions

options
)

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

Promise<void>

connect(

ConnectionOptions

options
)

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

Promise<void>

disconnect()

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

Promise<LoginResult>

login(

PasswordLoginOptions

options
)

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

Promise<LoginResult>

loginAccessToken(

AccessTokenLoginOptions

options
)

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

Promise<LoginResult>

loginOneTimeKey(

OneTimeKeyLoginOptions

options
)

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

Promise<LoginTokens>

refreshTokens(

RefreshTokenOptions

options
)

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

void

removeEventListener(

ClientEvent.Disconnected

eventName,

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

listener
)

Removes a previously registered handler for the specified event.

Parameters

Returns

  • type:

    void

requestOneTimeKey

Copy URL

Promise<string>

requestOneTimeKey(

RequestOneTimeKeyOptions

options
)

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
public  state

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