- Reduced latency: Your code runs directly alongside the browser, reducing round-trip latency
- Improved reliability: Fewer unexpected disconnects between your code and browser
- Higher throughput: Eliminates bandwidth bottlenecks during data-intensive operations like screenshots
Apps, Actions, and Invocations
AnApp
is a codebase deployed on Kernel. You can deploy any codebase in Typescript or Python on Kernel.
An Action
is an invokable method within an app. Actions allow your to register entry points or functions that can be triggered on-demand. Actions can call non-action methods. Apps can have multiple actions.
An Invocation
is a single execution of an action. Invocations can be triggered via API, scheduled as a job, or run on-demand.
Getting started: create an app
First, install the Kernel SDK for your language:Parameters
Action methods receive two parameters:runtimeContext
: Contextual information provided by Kernel during executionpayload
: Optional runtime data that you provide when invoking the action (max 64 KB). Read more
Environment variables
You can set environment variables when deploying your app. They then can be accessed in the usual way:Return values
Action methods can return values, which will be returned in its invocation’s final response.Building browser automations with Kernel apps
To implement a browser automation or web agent, instantiate an app and define an action that creates a Kernel browser.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.Web agent frameworks sometimes require environment variables (e.g. LLM API keys). Set them when deploying your app.