Skip to main content
POST
/
browsers
/
{id}
/
computer
/
press_key
JavaScript
import Kernel from '@onkernel/sdk';

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

await client.browsers.computer.pressKey('id', { keys: ['string'] });
{
  "code": "bad_request",
  "message": "Missing required field: app_name",
  "details": [
    {
      "code": "invalid_input",
      "message": "Provided version string is not semver compliant"
    }
  ],
  "inner_error": {
    "code": "invalid_input",
    "message": "Provided version string is not semver compliant"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Browser session ID

Body

application/json
keys
string[]
required

List of key symbols to press. Each item should be a key symbol supported by xdotool (see X11 keysym definitions). Examples include "Return", "Shift", "Ctrl", "Alt", "F5". Items in this list could also be combinations, e.g. "Ctrl+t" or "Ctrl+Shift+Tab".

duration
integer
default:0

Duration to hold the keys down in milliseconds. If omitted or 0, keys are tapped.

Required range: x >= 0
hold_keys
string[]

Optional modifier keys to hold during the key press sequence.

Response

Keys pressed successfully