AgentInfo
InterfaceGet automation and device metadata
Access these methods through agent.info. Provides information about the current automation and the device it's running on.
interface AgentInfo { getAutomationInfo(): AutomationInfo; getDeviceInfo(): DeviceInfo; getPhoneNumber(): string | null; // Since 2.138 getVerifiedPhoneNumber(): Promise<string | null>;}Methods
getAutomationInfo()
getAutomationInfo(): AutomationInfoReturns metadata about the currently running automation.
Returns
AutomationInfoAutomation metadata
Examples
const info = agent.info.getAutomationInfo();console.log("Running:", info.name);console.log("Launch ID:", info.launchId);console.log("Server:", info.serverBaseUrl);getDeviceInfo()
getDeviceInfo(): DeviceInfoReturns information about the device hardware and configuration.
Returns
DeviceInfoDevice specifications
Examples
const device = agent.info.getDeviceInfo();console.log("Device:", device.brand, device.model);console.log("Screen:", device.width, "x", device.height);console.log("Android SDK:", device.sdkVersion);console.log("Is Emulator:", device.isEmulator);getPhoneNumber()
getPhoneNumber(): string | nullReturns the phone number of the device's SIM card. Returns null if unavailable (no SIM inserted, permission not granted, or carrier doesn't provide the number). Requires phone/SMS permissions to be granted on the device.Since 2.138 (150)
Returns
string | nullPhone number string or null if unavailable
Examples
const phoneNumber = agent.info.getPhoneNumber();if (phoneNumber) { console.log("Device phone number:", phoneNumber);} else { console.log("Phone number not available");}getVerifiedPhoneNumber()
getVerifiedPhoneNumber(): Promise<string | null>Returns the phone number stored on the device record on the server, only if it has been marked verified there. Resolves to null when the device has no verified phone number, the agent token is missing (i.e. the automation is not running through a job/agent), or the request fails. Differs from getPhoneNumber, which reads the SIM directly on the device. Backed by GET /api/v2/devices/verified-phone-number.
Returns
Promise<string | null>Verified phone number from the device record, or null if not verified / unavailable
Examples
const verified = await agent.info.getVerifiedPhoneNumber();if (verified) { console.log("Verified phone number:", verified);} else { console.log("No verified phone number on file");}Types
AutomationInfo
Contains metadata about the running automation.
interface AutomationInfo { name: string; // Automation name description: string; // Automation description launchId: string; // Unique ID for this launch agent?: { // Optional agent details id: string; commitId: string; token: string; jobTaskId: string; }; serverBaseUrl: string; // Server URL for API calls timeout?: number; // Optional timeout in minutes available since app v2.123 (135)}AutomationInfo Properties
| Property | Type | Description |
|---|---|---|
name | string | The name of the automation |
description | string | Description of what the automation does |
launchId | string | Unique identifier for this execution |
agent? | object | Agent details when running in agent mode (id, commitId, token, jobTaskId) |
serverBaseUrl | string | Base URL of the server for API calls |
timeout? | number | Optional timeout for the automation in minutes (since v2.123 (135)) |
DeviceInfo
Contains hardware and configuration information about the device.
interface DeviceInfo { id: string; // Unique device ID brand: string; // Device brand (e.g., "Samsung") model: string; // Device model (e.g., "SM-G991B") sdkVersion: number; // Android SDK version (e.g., 33) processor: string; // CPU info numberOfCores: number; // CPU core count ramMb: number; // RAM in megabytes country: string; // Device country isEmulator: boolean; // true if running on emulator width: number; // Screen width in pixels height: number; // Screen height in pixels}DeviceInfo Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for the device |
brand | string | Device manufacturer (e.g., 'Samsung', 'Google') |
model | string | Device model name |
sdkVersion | number | Android SDK API level (e.g., 33 for Android 13) |
processor | string | CPU/processor information |
numberOfCores | number | Number of CPU cores |
ramMb | number | Total RAM in megabytes |
country | string | Device country/region setting |
isEmulator | boolean | Whether the device is an emulator |
width | number | Screen width in pixels |
height | number | Screen height in pixels |
Usage Example
// Adapt automation to device capabilitiesconst device = agent.info.getDeviceInfo();
// Calculate center of screenconst centerX = device.width / 2;const centerY = device.height / 2;
// Check Android version for feature availabilityif (device.sdkVersion >= 33) { // Use Android 13+ features}
// Log automation contextconst automation = agent.info.getAutomationInfo();console.log(`Running "${automation.name}" on ${device.brand} ${device.model}`);