Node.js SDK
Import-ready Lexmount Node.js SDK documentation for Lex Home.
Lexmount Node.js SDK is the JavaScript and TypeScript entry point for creating remote browser sessions, managing persistent contexts, uploading extensions, and retrieving session downloads.
Features
- Typed API for TypeScript and modern Node.js runtimes
- ESM and CommonJS compatible package output
- Session creation, listing, and deletion
- Persistent context creation, inspection, deletion, and force-release
- Extension upload, list, get, and delete
- Session downloads list, fetch, archive, and clear
- Structured error types for auth, network, timeout, and context-lock cases
- Configurable SDK logging
Installation
npm install lexmountRequirements:
- Node.js 18+
- npm 9+ recommended
playwrightoptional, only needed when connecting to browser sessions
Runtime Configuration
Environment Variables
export LEXMOUNT_API_KEY="your-api-key"
export LEXMOUNT_PROJECT_ID="your-project-id"
export LEXMOUNT_BASE_URL="https://api.lexmount.cn" # OptionalOr use a .env file:
LEXMOUNT_API_KEY=your-api-key
LEXMOUNT_PROJECT_ID=your-project-id
LEXMOUNT_BASE_URL=https://api.lexmount.cnThe SDK reads credentials from constructor options first, then falls back to environment variables. If LEXMOUNT_BASE_URL is omitted, the default base URL is https://api.lexmount.cn.
What To Read Next
- Quick Start for installation, configuration, and first connection.
- Capabilities for sessions, contexts, extensions, downloads, logging, and errors.
- Examples for runnable scripts from the SDK repository.
Lexmount Docs