1. Create a Kernel browser
First, install the Kernel SDK:
- Typescript/Javascript:
npm install @onkernel/sdk - Python:
pip install kernel
2. Connect to the browser
Kernel browsers support three connection methods: CDP for framework-level browser automation, WebDriver BiDi for W3C-standard control, and Computer Controls for OS-level mouse/keyboard input ideal for vision-based LLM loops.- CDP
- WebDriver BiDi
- Computer Controls
Connect with any Chrome DevTools Protocol framework like Playwright or Puppeteer. Use
cdp_ws_url from the created browser session.3. Tear it down
When you’re finished with the browser, you can delete it:Full example
Once you’ve connected to the Kernel browser, you can do anything with it.Kernel browsers launch with a default context and page. Make sure to access
the existing context and
page
(
contexts()[0] and pages()[0]), rather than trying to create a new one.