## Get a browser session ID. `client.browserRendering.devtools.browser.create(BrowserCreateParamsparams, RequestOptionsoptions?): BrowserCreateResponse` **post** `/accounts/{account_id}/browser-rendering/devtools/browser` Acquires a browser and returns its session ID and websocket URL. Optionally accepts a JSON body with session guardrails to restrict outbound HTTP/S traffic. ### Parameters - `params: BrowserCreateParams` - `account_id: string` Path param: Account ID. - `keep_alive?: number` Query param: Keep-alive time in milliseconds. - `lab?: boolean` Query param: Use experimental browser. - `liveViewUrlExpiresInMs?: number` Query param: How long the live view URL remains valid, in milliseconds (max 60 minutes). Only used when targets is true. - `recording?: boolean` Query param - `targets?: boolean` Query param: Include browser targets in response. - `guardrails?: Guardrails` Body param - `allowedDomains?: Array` Hostname patterns, max 50. Supports exact hosts (example.com) or a single * wildcard anywhere. Prefer *.example.com (subdomain wildcard) over *example.com (prefix wildcard) to avoid matching overbroad lookalikes like evilexample.com. - `allowedDomainSets?: Array` Max 4 entries: curated preset names (common-cdns) and/or https URLs of newline-separated hostname lists. ### Returns - `BrowserCreateResponse` - `sessionId: string` Browser session ID. - `webSocketDebuggerUrl?: string` WebSocket URL for the session. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const browser = await client.browserRendering.devtools.browser.create({ account_id: 'account_id' }); console.log(browser.sessionId); ``` #### Response ```json { "sessionId": "sessionId", "webSocketDebuggerUrl": "webSocketDebuggerUrl" } ```