Node.js SDK
The Node.js SDK lets you manage Incogniton profiles, cookies, and run full browser automation from JavaScript/TypeScript by talking to the locally running Incogniton desktop app. Everything stays on your machine—no remote tokens, no cloud roundtrips.
Requirements
Before installing and using the Node.js SDK, ensure you have the following in place:
- Incogniton account — Sign up here if you don’t already have one.
- Incogniton desktop app — Download the app and ensure it’s open and running on your machine.
- At least one browser profile created within the Incogniton app.
- Node.js 16+ installed on your machine.
- Familiarity with using
async/await
in JavaScript/TypeScript.
The SDK requires the Incogniton desktop app to be running locally. API calls will not work if the app is closed.
Installation
To get started with the Node.js SDK, you first need to install it. The installation process is straightforward and supports npm, yarn, and pnpm package managers.
Install Node.js SDK
npm install incogniton
How to Use the SDK
The Incogniton Node.js SDK provides a simple, fully async API for managing browser profiles and automating browsers. Below are common usage examples to help you get started quickly.
All SDK calls run locally on your machine — No API tokens or extra authentication required.
API Client usage example
Use the API client for profile lifecycle and cookies. The SDK is fully async—await
every operation that hits the app.
API Client Example
import { IncognitonClient } from 'incogniton'
const client = new IncognitonClient()
// Create a profile
const created = await client.profile.add({
profileData: {
name: 'My Profile',
// ...other fields
},
})
// List profiles
const profiles = await client.profile.list()
// Get a specific profile
const profileId = 'your_profile_id'
const profile = await client.profile.get(profileId)
// Launch (starts a local, profile-bound browser)
await client.profile.launch(profileId)
// Stop when done
await client.profile.stop(profileId)
// ESM assumes "type": "module" — for CommonJS, wrap "await" in an async function.
Browser Automation usage example
Attach Playwright (or Puppeteer) to the running, profile-bound browser via CDP. This example shows Playwright, the Puppeteer variant is below.
Browser Automation Example
import { IncognitonClient, IncognitonBrowser } from 'incogniton'
const client = new IncognitonClient()
const profileId = 'your-profile-id'
// Ensure the profile's browser is running
await client.profile.launch(profileId)
// Controller bound to that profile
const browser = new IncognitonBrowser({
profileId,
headless: true,
})
// Establish CDP session → Playwright Browser
const pwBrowser = await browser.startPlaywright()
const page = await pwBrowser.newPage()
await page.goto('https://example.com')
await page.screenshot({ path: 'example.png' })
// Clean shutdown (frees resources)
await browser.close(pwBrowser)
// Optionally stop the profile/browser
await client.profile.stop(profileId)
Headless mode
When you run automation in headless mode, the browser UI doesn’t open. This reduces resource consumption and speeds up execution, making it ideal for high-volume automation tasks.
Running in Headless Mode
import { IncognitonBrowser } from 'incogniton'
const browser = new IncognitonBrowser({
profileId: 'your-profile-id',
headless: true, // Enables headless mode
})
SDK Overview
The SDK is a local-first async
client. It sends your commands to the Incogniton app’s Local API, which launches profile-bound browsers for automation. The SDK then connects via CDP or WebDriver so you can control pages using automation tools like Playwright, Puppeteer, or Selenium.
[Your JS/TS Script] ──(async/await)──> [Incogniton SDK]
│
▼
Local API @ http://localhost:35000
│
CDP / Web Driver bridge (Playwright/Puppeteer/Selenium)
▼
[Profile-Bound Incogniton Browser (Chromium)]
All operations are async. Chain actions with await
to keep
control flow predictable and to surface errors promptly.
IncognitonClient
— Reference
Use Incogniton Client for local API actions: profiles, cookies, and starting automation-ready sessions.
Configuration:
Option | Purpose |
---|---|
baseUrl | Local API address (default http://localhost:35000 ). |
port | Convenience override for the local API port. |
timeout | Request timeout for client calls (if supported). |
Profile Operations (client.profile
)
High-level lifecycle and metadata management.
Method | What it does |
---|---|
client.profile.list | List all browser profiles. |
client.profile.get | Get a specific profile by ID. |
client.profile.add | Create a new profile. |
client.profile.update | Update an existing profile. |
client.profile.switch_proxy | Update a profile’s proxy settings. |
client.profile.launch | Launch the profile locally (starts the browser). |
client.profile.launch_force_local | Launch using only local data. |
client.profile.launch_force_cloud | Launch with a fresh cloud sync. |
client.profile.get_status | Check current profile status/readiness. |
client.profile.stop | Stop the running profile/browser. |
client.profile.force_stop | Force stop a running profile/browser immediately. |
client.profile.delete | Delete a profile. |
Cookie Operations (client.cookie
)
Manage cookies without opening a browser.
Method | What it does |
---|---|
client.cookie.get | Get all cookies for a profile. |
client.cookie.add | Add cookies to a profile. |
client.cookie.delete | Delete all cookies for a profile. |
Automation Operations (client.automation
)
Prepare sessions and get connection endpoints.
Method | What it does |
---|---|
client.automation.launch_puppeteer | Launch for Puppeteer; returns a DevTools URL. |
client.automation.launch_puppeteer_custom | Same, with extra Chromium flags. |
client.automation.launch_selenium | Launch for Selenium; returns a WebDriver URL. |
client.automation.launch_selenium_custom | Same, with custom ChromeOptions/flags. |
IncognitonBrowser
— Reference
Use Incogniton Browser to attach Playwright/Puppeteer/Selenium to a running, profile-bound browser. Prefer reusing a single controller per worker
Configuration:
Option | Purpose |
---|---|
profileId | Which Incogniton profile to launch/attach. |
headless | Run without a visible window (default false ). |
customArgs | Extra Chromium flags (e.g. --no-sandbox ). |
launchTimeout | Max time to wait for readiness (ms). |
Endpoints & Methods:
Method | What it does |
---|---|
browser.start_playwright | Return a connected Playwright Browser (CDP). |
browser.start_selenium | Return a connected Selenium WebDriver . |
browser.close | Close a single Playwright browser instance. |
browser.close_all | Close multiple Playwright instances in parallel. |
Troubleshooting & FAQs
Yes. You can customize fingerprint settings either in the Incogniton app (edit your profile’s fingerprint settings before launching) or programmatically via the SDK/API. You can set timezone, language, screen resolution, fonts, WebRTC, and more to align with your target environment. See the API Reference at the end of this page for details.
Ensure the Incogniton desktop app is running and you’re logged in. • Check the profile isn’t already open — stop it before relaunching. If stuck syncing, try the “force local” launch option.
Confirm Incogniton is running on the same machine and that your plan includes
API access. Default port is 35000
— verify it hasn’t been changed in
settings. Check firewall rules to ensure the port isn’t blocked.
Launch a profile via the automation API or SDK, wait until it’s ready, then
connect with puppeteer.connect()
using the provided DevTools URL. • Install
puppeteer-core
instead of full Puppeteer. See the Scraping with Incogniton
guide for detailed steps.
No. Incogniton bundles its own Chromium build.
• No ChromeDriver or separate browser install is required.
Next Steps:
How-to Guides
Step-by-step guides for common automation and integration tasks.
Python SDK
Prefer Python? Use the same capabilities with async/await and Playwright/Selenium.
Need help? Join our community or contact support.