Session Client API
Generated client method reference for the session namespace.
This page documents 16 schema-registry client methods in the session namespace.
getBatteryLevel
Get phone battery level
Signature client.getBatteryLevel(): Promise<number>
Usage
const result = await client.getBatteryLevel();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<number> |
Resolves to number. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<number>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getBatteryLevel |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getBatteryLevel | getBatteryLevel | Active |
| Alias | GET | /api/getBatteryLevel | getBatteryLevel | Active |
getConnectionState
Get connection state
Signature client.getConnectionState(): Promise<string>
Usage
const result = await client.getConnectionState();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<string>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getConnectionState |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getConnectionState | getConnectionState | Active |
| Alias | GET | /api/getConnectionState | getConnectionState | Active |
getFeatures
Get enabled features
Signature client.getFeatures(): Promise<FeatureFlags>
Usage
const result = await client.getFeatures();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<FeatureFlags> |
| FeatureFlags | View fields |
WhatsApp feature flags keyed by name. Values are provider-defined and must be narrowed before use.
In-process Client resolves to Promise<Record<string, unknown>>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
WhatsApp feature flags keyed by name. Values are provider-defined and must be narrowed before use.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getFeatures |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getFeatures | getFeatures | Active |
| Alias | GET | /api/getFeatures | getFeatures | Active |
getHostNumber
Get host phone number
Signature client.getHostNumber(): Promise<string>
Usage
const result = await client.getHostNumber();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<string>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getHostNumber |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getHostNumber | getHostNumber | Active |
| Alias | GET | /api/getHostNumber | getHostNumber | Active |
getLicenseType
Get license type
Signature client.getLicenseType(): Promise<LicenseType \| false>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getLicenseType();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<LicenseType | false> |
| LicenseType | View fields |
Resolves to LicenseType \| false. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getLicenseType |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getLicenseType | getLicenseType | Active |
| Alias | GET | /api/getLicenseType | getLicenseType | Active |
getLoadedMessageCount
Get loaded message count
Signature client.getLoadedMessageCount(): Promise<number>
Usage
const result = await client.getAmountOfLoadedMessages();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<number> |
Resolves to number. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<number>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | getAmountOfLoadedMessages, session.getAmountOfLoadedMessages, session.getLoadedMessageCount |
| Deprecated aliases | getAmountOfLoadedMessages, session.getAmountOfLoadedMessages |
| License | none |
| WAPI override | getAmountOfLoadedMessages |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getLoadedMessageCount | getLoadedMessageCount | Active |
| Deprecated alias | GET | /api/getAmountOfLoadedMessages | getAmountOfLoadedMessages | Deprecated |
| Alias | GET | /api/getLoadedMessageCount | getLoadedMessageCount | Active |
| Deprecated alias | GET | /api/session/getAmountOfLoadedMessages | session.getAmountOfLoadedMessages | Deprecated |
getMe
Get host account info
Signature client.getMe(): Promise<HostAccount>
Usage
const result = await client.getMe();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<HostAccount> |
| HostAccount | View fields |
Host account attributes plus the current account ID. Additional WhatsApp Web attributes vary by version.
In-process Client resolves to Promise<HostAccount>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Host account attributes plus the current account ID. Additional WhatsApp Web attributes vary by version.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getMe |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getMe | getMe | Active |
| Alias | GET | /api/getMe | getMe | Active |
getProcessStats
Get process statistics
Signature client.getProcessStats(): Promise<ProcessStats>
Usage
const result = await client.getProcessStats();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<ProcessStats> |
| ProcessStats | View fields |
Process diagnostics keyed by process ID. The provider controls each entry; no stable entry shape is guaranteed.
In-process Client resolves to Promise<Record<string, unknown>>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Process diagnostics keyed by process ID. The provider controls each entry; no stable entry shape is guaranteed.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.getProcessStats |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getProcessStats | getProcessStats | Active |
| Alias | GET | /api/getProcessStats | getProcessStats | Active |
getSnapshot
Take screenshot
Signature client.getSnapshot(chatId?: string, width?: number, height?: number): Promise<string>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getSnapshot();Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId, width, height |
| Aliases | session.getSnapshot, session.takeScreenshot, takeScreenshot |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getSnapshot | getSnapshot | Active |
| Alias | GET | /api/getSnapshot | getSnapshot | Active |
| Alias | GET | /api/session/takeScreenshot | session.takeScreenshot | Active |
| Alias | GET | /api/takeScreenshot | takeScreenshot | Active |
getUserAgent
Get user agent
Signature client.getUserAgent(userAgent?: string): Promise<string>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getUserAgent();Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | userAgent |
| Aliases | getGeneratedUserAgent, session.getGeneratedUserAgent, session.getUserAgent |
| Deprecated aliases | getGeneratedUserAgent, session.getGeneratedUserAgent |
| License | none |
| WAPI override | getGeneratedUserAgent |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getUserAgent | getUserAgent | Active |
| Deprecated alias | GET | /api/getGeneratedUserAgent | getGeneratedUserAgent | Deprecated |
| Alias | GET | /api/getUserAgent | getUserAgent | Active |
| Deprecated alias | GET | /api/session/getGeneratedUserAgent | session.getGeneratedUserAgent | Deprecated |
getWAVersion
Get WhatsApp Web version
Signature client.getWAVersion(): Promise<string>
Usage
const result = await client.getWAVersion();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<string>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | getWhatsAppVersion, session.getWAVersion, session.getWhatsAppVersion |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/getWAVersion | getWAVersion | Active |
| Alias | GET | /api/getWAVersion | getWAVersion | Active |
| Alias | GET | /api/getWhatsAppVersion | getWhatsAppVersion | Active |
| Alias | GET | /api/session/getWhatsAppVersion | session.getWhatsAppVersion | Active |
healthCheck
Health check
Signature client.healthCheck(): Promise<HealthCheck>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.healthCheck();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<HealthCheck> |
| HealthCheck | View fields |
Browser health diagnostics. This is not the Easy API /health HTTP envelope.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Browser health diagnostics. This is not the Easy API /health HTTP envelope.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | session.healthCheck |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/healthCheck | healthCheck | Active |
| Alias | GET | /api/healthCheck | healthCheck | Active |
isPlugged
Check if phone is charging
Signature client.isPlugged(): Promise<boolean>
Usage
const result = await client.getIsPlugged();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | getIsPlugged, session.getIsPlugged, session.isPlugged |
| Deprecated aliases | getIsPlugged, session.getIsPlugged |
| License | none |
| WAPI override | getIsPlugged |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/session/isPlugged | isPlugged | Active |
| Deprecated alias | GET | /api/getIsPlugged | getIsPlugged | Deprecated |
| Alias | GET | /api/isPlugged | isPlugged | Active |
| Deprecated alias | GET | /api/session/getIsPlugged | session.getIsPlugged | Deprecated |
setMyName
Set host name
Signature client.setMyName(name: string): Promise<boolean>
Usage
const result = await client.setMyName("OpenWA Bot");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | update |
| Functionality | personal-only |
| Positional parameter order | name |
| Aliases | session.setDisplayName, session.setMyName, session.setName, setDisplayName |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/session/setName | setMyName | Active |
| Alias | PUT | /api/session/setDisplayName | session.setDisplayName | Active |
| Alias | PUT | /api/session/setMyName | session.setMyName | Active |
| Alias | PUT | /api/setDisplayName | setDisplayName | Active |
| Alias | PUT | /api/setMyName | setMyName | Active |
setMyStatus
Set host status
Signature client.setMyStatus(statusText: string): Promise<boolean>
Usage
const result = await client.setMyStatus("Available");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | update |
| Functionality | both |
| Positional parameter order | statusText |
| Aliases | session.setMyStatus, session.setStatus, session.setStatusText, setStatusText |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/session/setStatus | setMyStatus | Active |
| Alias | PUT | /api/session/setMyStatus | session.setMyStatus | Active |
| Alias | PUT | /api/session/setStatusText | session.setStatusText | Active |
| Alias | PUT | /api/setMyStatus | setMyStatus | Active |
| Alias | PUT | /api/setStatusText | setStatusText | Active |
setProfilePicture
Set profile picture
Signature client.setProfilePicture(image: string): Promise<boolean>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.setProfilePicture({
image: "data:image/png;base64,iVBORw0KGgo...",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | session |
| Action | update |
| Functionality | both |
| Positional parameter order | image |
| Aliases | session.setProfilePic, session.setProfilePicture, setProfilePic |
| Deprecated aliases | session.setProfilePic, setProfilePic |
| License | insiders |
| WAPI override | setProfilePic |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/session/setProfilePicture | setProfilePicture | Active |
| Deprecated alias | PUT | /api/session/setProfilePic | session.setProfilePic | Deprecated |
| Deprecated alias | PUT | /api/setProfilePic | setProfilePic | Deprecated |
| Alias | PUT | /api/setProfilePicture | setProfilePicture | Active |
Was this helpful?
Your answer includes the page path and docs version.
