Skip to main content

Configure Session Options

Complete reference for all options available when creating a session with the TestMu AI Browser SDK. Use these to control stealth, persistence, browser settings, network, and extensions.

When you call client.sessions.create(), you can pass these options to configure the session's behavior, browser settings, and capabilities.

Quick Example

Here is a typical create call that sets the most common options:

const session = await client.sessions.create({
adapter: 'playwright',
dimensions: { width: 1920, height: 1080 },
blockAds: true,
stealthConfig: {
humanizeInteractions: true,
randomizeUserAgent: true,
},
proxy: 'http://my-proxy:8080',
lambdatestOptions: {
build: 'my-build',
name: 'my-test',
user: process.env.LT_USERNAME,
accessKey: process.env.LT_ACCESS_KEY,
},
});

The sections below describe every available option in detail.

Required Options

OptionTypeDescription
adapter'puppeteer' | 'playwright' | 'selenium'Which automation library to use
lambdatestOptionsobjectTestMu AI capabilities (build name, test name, credentials)

Stealth Options

OptionTypeDefaultDescription
stealthConfig.humanizeInteractionsbooleanfalseAdd random delays to clicks and typing
stealthConfig.randomizeUserAgentbooleantruePick random user-agent from pool
stealthConfig.randomizeViewportbooleantrueAdd ±20px jitter to viewport
stealthConfig.skipFingerprintInjectionbooleanfalseDisable all stealth

→ Learn more: Avoid bot detection with Stealth Mode

Persistence Options

OptionTypeDescription
profileIdstringLoad/save persistent browser profile
sessionContextSessionContextPre-load cookies, localStorage, sessionStorage

Browser Options

OptionTypeDefaultDescription
dimensions{ width, height }-Browser viewport size
userAgentstring-Custom user-agent string
headlessboolean-Run in headless mode
timeoutnumber300000Session timeout in ms (5 min)
blockAdsboolean-Block advertisements
solveCaptchaboolean-Enable CAPTCHA solving

Network Options

OptionTypeDescription
proxystringProxy URL
geoLocationstringGeolocation code (e.g. 'US', 'IN')
tunnelbooleanEnable TestMu AI tunnel
tunnelNamestringNamed tunnel identifier
regionstringTestMu AI data center region
optimizeBandwidthboolean | configBlock images/media/styles

Extension Options

OptionTypeDescription
extensionIdsstring[]Chrome extension IDs to load

Session Object

After creation, you receive a Session object with these fields:

interface Session {
id: string; // Unique session ID
websocketUrl: string; // WebSocket URL for adapter connection
debugUrl: string; // TestMu AI dashboard URL
config: SessionConfig; // Original configuration
status: 'live' | 'released' | 'failed';
createdAt: string; // ISO timestamp
timeout: number; // Session timeout in ms
dimensions: Dimensions; // Viewport dimensions
sessionViewerUrl?: string; // Live session viewer URL
userAgent?: string; // Resolved user-agent
stealthConfig?: StealthConfig; // Active stealth settings
}

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles