import Kernel from '@onkernel/sdk';
const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});
const browserPool = await client.browserPools.retrieve('id_or_name');
console.log(browserPool.id);{
"id": "iv25ujqf37x3j07dwoffegqr",
"available_count": 85,
"acquired_count": 15,
"created_at": "2023-11-07T05:31:56Z",
"browser_pool_config": {
"size": 10,
"name": "my-pool",
"fill_rate_per_minute": 10,
"timeout_seconds": 600,
"stealth": true,
"headless": false,
"profile": {
"id": "<string>",
"name": "<string>",
"save_changes": false
},
"extensions": [
{
"id": "<string>",
"name": "<string>"
}
],
"proxy_id": "<string>",
"viewport": {
"width": 1280,
"height": 800,
"refresh_rate": 60
},
"kiosk_mode": true
},
"name": "my-pool"
}Retrieve details for a single browser pool by its ID or name.
import Kernel from '@onkernel/sdk';
const client = new Kernel({
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
});
const browserPool = await client.browserPools.retrieve('id_or_name');
console.log(browserPool.id);{
"id": "iv25ujqf37x3j07dwoffegqr",
"available_count": 85,
"acquired_count": 15,
"created_at": "2023-11-07T05:31:56Z",
"browser_pool_config": {
"size": 10,
"name": "my-pool",
"fill_rate_per_minute": 10,
"timeout_seconds": 600,
"stealth": true,
"headless": false,
"profile": {
"id": "<string>",
"name": "<string>",
"save_changes": false
},
"extensions": [
{
"id": "<string>",
"name": "<string>"
}
],
"proxy_id": "<string>",
"viewport": {
"width": 1280,
"height": 800,
"refresh_rate": 60
},
"kiosk_mode": true
},
"name": "my-pool"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Browser pool ID or name
Browser pool details
A browser pool containing multiple identically configured browsers.
Unique identifier for the browser pool
"iv25ujqf37x3j07dwoffegqr"
Number of browsers currently available in the pool
85
Number of browsers currently acquired from the pool
15
Timestamp when the browser pool was created
Configuration used to create all browsers in this pool
Show child attributes
Number of browsers to create in the pool
1 <= x <= 5010
Optional name for the browser pool. Must be unique within the organization.
"my-pool"
Percentage of the pool to fill per minute. Defaults to 10%.
0 <= x <= 25Default idle timeout in seconds for browsers acquired from this pool before they are destroyed. Defaults to 600 seconds if not specified
60 <= x <= 86400If true, launches the browser in stealth mode to reduce detection by anti-bot mechanisms.
true
If true, launches the browser using a headless image. Defaults to false.
false
Profile selection for the browser session. Provide either id or name. If specified, the matching profile will be loaded into the browser session. Profiles must be created beforehand.
Show child attributes
Profile ID to load for this browser session
Profile name to load for this browser session (instead of id). Must be 1-255 characters, using letters, numbers, dots, underscores, or hyphens.
1 - 255If true, save changes made during the session back to the profile when the session ends.
List of browser extensions to load into the session. Provide each by id or name.
20Extension selection for the browser session. Provide either id or name of an extension uploaded to Kernel.
Show child attributes
Extension ID to load for this browser session
Extension name to load for this browser session (instead of id). Must be 1-255 characters, using letters, numbers, dots, underscores, or hyphens.
1 - 255Optional proxy to associate to the browser session. Must reference a proxy belonging to the caller's org.
Initial browser window size in pixels with optional refresh rate. If omitted, image defaults apply (commonly 1024x768@60). Only specific viewport configurations are supported. The server will reject unsupported combinations. Supported resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be automatically determined from the width and height if they match a supported configuration exactly. Note: Higher resolutions may affect the responsiveness of live view browser
Show child attributes
Browser window width in pixels.
320 <= x <= 76801280
Browser window height in pixels.
240 <= x <= 4320800
Display refresh rate in Hz. If omitted, automatically determined from width and height.
60
If true, launches the browser in kiosk mode to hide address bar and tabs in live view.
true
Browser pool name, if set
"my-pool"