Browser Service
Create cloud browser sessions via the SDK. Returns a WebSocket endpoint for connecting Playwright, Puppeteer, or Selenium.
Methods
create(options?)
Create a browser session synchronously (waits for the browser to be ready).
const { browserWSEndpoint } = await client.browser.create({
proxyCountry: 'US',
sessionTTL: 300,
});createAsync(options?)
Create a browser session asynchronously.
const { browserWSEndpoint } = await client.browser.createAsync({
proxyCountry: 'US',
});createSession(options?)
Alias for create().
Options (ICreateBrowser)
interface ICreateBrowser {
sessionName?: string; // Custom session name
sessionTTL?: number; // Time-to-live in seconds
sessionRecording?: boolean; // Enable session recording
proxyCountry?: string; // 2-letter country code
proxyState?: string; // State/region
proxyCity?: string; // City
proxyURL?: string; // Custom proxy URL (BYOP)
proxyPoolId?: string; // Proxy pool ID
userProxyId?: string; // User proxy ID
fingerprint?: object; // Browser fingerprint config
extensionIds?: string; // Comma-separated extension IDs
profileId?: string; // Browser profile ID
profilePersist?: boolean; // Persist profile after session
}Response
interface ICreateBrowserResponse {
browserWSEndpoint: string; // WebSocket URL for connection
}Extension Service
Access the extension service through client.browser.extension:
// Upload extension
const ext = await client.browser.extension.upload('./ext.zip', 'My Ext');
// List extensions
const list = await client.browser.extension.list();
// Get extension details
const detail = await client.browser.extension.get('ext-id');
// Update extension
await client.browser.extension.update('ext-id', './ext-v2.zip', 'New Name');
// Delete extension
await client.browser.extension.delete('ext-id');