Appetize Docs
HomeDemoUploadPricing
  • Introduction
  • Platform
    • App Management
      • Uploading Apps
        • Android
        • iOS
      • App Dashboard
      • Running Apps
      • App Permissions
    • Device Sandbox
    • Embedding
    • Sharing
    • Session Inactivity Timeout
    • Query Params Reference
  • Features
    • Devices & OS Versions
    • Network Traffic Monitor
    • Debug Logs
    • UI Automation
    • Proxy
    • Language & Locale
    • Mock Location
    • Deep links
    • Launch Params
    • Media
    • Auto-grant Permissions
    • Custom Branding
    • Custom Launch Pages
    • Advanced Features
      • Android
        • ADB tunnel
        • Hide Password Visibility
      • Reserved Devices
  • Account
    • Invite your team
    • Single Sign-On
      • OpenID Connect
      • SAML
      • Azure Active Directory
      • Google Workspace (GSuite)
    • Reporting
      • Session History
      • Usage Summary
  • Infrastructure
    • Configure Network Access
    • Enterprise Hosting Options
  • JavaScript SDK
    • Configuration
    • Automation
      • Device commands
      • Touch interactions
    • API reference
      • Initialization
      • Client
      • Session
      • Types
        • AdbConnectionInfo
        • AppetizeApp
        • AndroidElementAttributes
        • Coordinates
        • DeviceInfo
        • Element
        • ElementBounds
        • IOSAccessibilityElement
        • IOSElementAttributes
        • NetworkRequest
        • NetworkResponse
        • SessionConfig
        • SwipeMove
        • RecordedAction
        • RecordedSwipeAction
        • RecordedKeypressAction
        • RecordedPosition
        • RecordedTapAction
        • RecordedTouchAction
        • UserInteraction
  • Testing
    • Getting Started
    • Writing Tests
    • Running Tests
    • Test Configuration
    • Continuous Integration
    • Record Tests (experimental)
    • Trace Viewer
    • Web Tests on Mobile Browsers
  • REST API
    • Create new app
    • Update existing app
    • Direct file uploads
    • Delete app
    • List apps
    • Usage summary
    • Devices & OS Versions
      • v1
    • IP Blocks
      • v1
    • Sample code
  • Guides & Samples
    • Impersonation
    • Automate Sign-in Flow
    • Screenshot Automation
    • Unlock Device
    • Validate Analytics Events
    • Lock Your Device to One App
    • Test Accessibility Font Sizes
    • Common testing scenarios
    • Samples Repository
  • Deprecated
    • Cross-document messages
  • Changelog
  • Additional Support
    • Knowledge Base
    • Support Request
Powered by GitBook
On this page
  • Methods
  • on(event, listener)
  • startSession()
  • setConfig()
  • getConfig()
  • endSession()
  • Properties
  • device
  • app
  1. JavaScript SDK
  2. API reference

Client

The client provides methods to configure the embedded device, manage sessions and listen to device related events.

Methods

on(event, listener)

Listens for an event of the given name

client.on(event, data => {
   console.log(data)
})
Event
Data Type
Description

app

deviceInfo

error

{ message: string }

An error has occurred

queue

{ type: "session | concurrent", position: number, name: string }

Your position in queue for the device.

  • concurrent: You've reached the max concurrent sessions for your account and are waiting for the next available slot. The concurrent queue name will be shown.

  • session: You're in a queue, waiting for the next available device.

queueEnd

void

The active queue has ended.

session

Session

sessionEnded

void

An active session has ended.

sessionRequested

void

A new session has been requested either by the client or user clicking "Tap to Play"

startSession()

Starts a session with the requested app, device, operating system, and other launch options.

const session = await client.startSession()

Parameters

Name
Type
Description

config?

setConfig()

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

getConfig()

Returns the current config

const config = client.getConfig()

endSession()

Ends the active session or cancels any pending session requests.

await client.endSession()

Properties

device

app

PreviousInitializationNextSession

Last updated 6 months ago

The currently loaded .

Information about the current , such as type, osVersion, and screen dimensions.

A new has started either by the client or user clicking "Tap to Play"

A JSON object describing the for the device.

A JSON object describing the for the device.

The currently loaded device. See .

The currently loaded app. See .

DeviceInfo
AppetizeApp
AppetizeApp
DeviceInfo
session
SessionConfig
SessionConfig
Appetize app
device
Configuration options
Configuration options