Skip to content
Start here

Open a new browser tab.

client.browserRendering.devtools.browser.targets.create(stringsessionID, TargetCreateParams { account_id, liveViewUrlExpiresInMs, url } params, RequestOptionsoptions?): TargetCreateResponse { id, type, url, 4 more }
PUT/accounts/{account_id}/browser-rendering/devtools/browser/{session_id}/json/new

Opens a new tab in the browser. Optionally specify a URL to navigate to.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
sessionID: string

Browser session ID.

formatuuid
params: TargetCreateParams { account_id, liveViewUrlExpiresInMs, url }
account_id: string

Path param: Account ID.

liveViewUrlExpiresInMs?: number

Query param: How long the live view URL remains valid, in milliseconds (max 60 minutes)

maximum3600000
minimum60000
url?: string

Query param

formaturi
ReturnsExpand Collapse
TargetCreateResponse { id, type, url, 4 more }
id: string

Target ID.

type: string

Target type (page, background_page, worker, etc.).

url: string

URL of the target.

description?: string

Target description.

devtoolsFrontendUrl?: string

DevTools frontend URL.

title?: string

Title of the target.

webSocketDebuggerUrl?: string

WebSocket URL for debugging this target.

Open a new browser tab.

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const target = await client.browserRendering.devtools.browser.targets.create(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { account_id: 'account_id' },
);

console.log(target.id);
{
  "id": "id",
  "type": "type",
  "url": "url",
  "description": "description",
  "devtoolsFrontendUrl": "devtoolsFrontendUrl",
  "title": "title",
  "webSocketDebuggerUrl": "webSocketDebuggerUrl"
}
Returns Examples
{
  "id": "id",
  "type": "type",
  "url": "url",
  "description": "description",
  "devtoolsFrontendUrl": "devtoolsFrontendUrl",
  "title": "title",
  "webSocketDebuggerUrl": "webSocketDebuggerUrl"
}