| description | The client provides methods to configure the embedded device, manage sessions and listen to device related events. |
|---|
Listens for an event of the given name
client.on(event, data => {
console.log(data)
})| Event | Data Type | Description |
|---|---|---|
| AppetizeApp | The currently loaded Appetize app. | |
| DeviceInfo | Information about the current device, such as type, osVersion, and screen dimensions. | |
{ message: string } | An error has occurred | |
{ type: "session | concurrent", position: number,name: string } | Your position in queue for the device.
| |
void | The active queue has ended. | |
Session | A new session has started either by the client or user clicking "Tap to Play" | |
void | An active session has ended. | |
void | A new session has been requested either by the client or user clicking "Tap to Play" |
Starts a session with the requested app, device, operating system, and other launch options.
const session = await client.startSession()Parameters
| Name | Type | Description |
|---|---|---|
config? |
SessionConfig | A JSON object describing the Configuration options for the device. |
Update the configured app, device, operating system, or other launch options.
Note: This will end any active sessions.
await client.setConfig(config)Parameters
| Name | Type | Description |
|---|---|---|
config |
SessionConfig | A JSON object describing the Configuration options for the device. |
Returns the current config
const config = client.getConfig()Ends the active session or cancels any pending session requests.
await client.endSession()The currently loaded device. See DeviceInfo.
The currently loaded app. See AppetizeApp.