Node.js Examples
Choose a runnable Node.js quickstart script by browser task.
The maintained scripts live in the Node.js quickstart repository. Clone that repository when you need runnable examples; this page is the map, not a second copy of every script.
Setup
git clone https://github.com/lexmount/lexmount-js-sdk-quickstart.git
cd lexmount-js-sdk-quickstart
npm install
cp .env.example .envFill in LEXMOUNT_API_KEY and LEXMOUNT_PROJECT_ID, then start with:
npm run demoBrowser creation and connection
| Command | What it demonstrates |
|---|---|
npm run demo | Create Chromium, connect with Playwright, navigate, and take a screenshot |
npm run light-demo | Create Moli (browserMode: 'light') and extract links |
npm run catalog-info | Inspect the region catalog and selected endpoint |
npm run connection-demo | Connect through the direct /connection endpoint |
npm run custom-image-demo | Start a session with customImageId |
npm run window-size-demo | Set and verify the ACE window size |
npm run inspect-url-demo | Print the console View URL |
npm run session-list | List session status and metadata |
npm run session-targets | List page/target metadata from /json |
npm run session-downloads | Trigger a download and save the stored archive |
Persistent contexts
| Command | What it demonstrates |
|---|---|
npm run context-basic | Create a context and mount it read-write |
npm run context-list-get | List contexts and retrieve one detail record |
npm run context-fork -- <context_id> | Copy an available offline context |
npm run context-modes | Compare read-write and read-only access |
npm run context-lock-handling | Handle locks and retry information |
Extensions and proxies
| Command | What it demonstrates |
|---|---|
npm run extension-basic | Upload and mount an extension archive |
npm run extension-list-get | List uploaded extensions and retrieve details |
npm run proxy-demo | Use an authenticated custom upstream proxy |
npm run official-proxy-demo | Use the Lexmount official proxy pool |
Some scripts require additional values documented in .env.example, such as an extension path, custom image ID, or proxy credentials. Feature availability depends on the project plan.
Cleanup
The examples close browser connections, sessions, and the SDK client in finally. If a process is interrupted, inspect active sessions in the console before rerunning it.
Lexmount Browser