Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tbd-6fc993ce-mintlify-profile-hot-load-save-changes-21459.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

To launch a web automation or web agent that authenticates on behalf of users, there are multiple ways to pass the credentials on the Kernel app platform:

1. Deployment environment variables

Deploy your app with the credentials as environment variables. Then, your invocation can use them at runtime.
app.action('authenticated-action', async (ctx: KernelContext) => {
  const username = process.env.USERNAME;
  const password = process.env.PASSWORD;
  if (!loggedIn()) {
    login(username, password);
  }
});

2. Runtime variables

For use cases that login on behalf of many users (such as platforms acting on behalf of end users), pass the credentials at runtime using the payload parameter. Make sure to use encryption standards in your app to protect the credentials.
app.action('authenticated-action', async (ctx: KernelContext, payload) => {
  if (!loggedIn()) {
    const username = decrypt(payload.encryptedUserName);
    const password = decrypt(payload.encryptedPassword);
    login(username, password);
  }
});