Skip to main content
POST
/
auth
/
connections
/
{id}
/
login
JavaScript
import Kernel from '@onkernel/sdk';

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

const loginResponse = await client.auth.connections.login('id');

console.log(loginResponse.id);
{
  "id": "ma_abc123xyz",
  "flow_type": "LOGIN",
  "hosted_url": "https://auth.kernel.com/login/abc123xyz",
  "flow_expires_at": "2025-11-05T20:00:00Z",
  "handoff_code": "aBcD123EfGh456IjKl789MnOp012QrStUvWxYzAbCdEf",
  "live_view_url": "https://live.onkernel.com/abc123xyz"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Auth connection ID

Body

application/json

Request to start a login flow

save_credential_as
string

If provided, saves credentials under this name upon successful login

Example:

"my-netflix-login"

Response

Login flow started

Response from starting a login flow

id
string
required

Auth connection ID

Example:

"ma_abc123xyz"

flow_type
enum<string>
required

Type of login flow started

Available options:
LOGIN,
REAUTH
Example:

"LOGIN"

hosted_url
string<uri>
required

URL to redirect user to for login

Example:

"https://auth.kernel.com/login/abc123xyz"

flow_expires_at
string<date-time>
required

When the login flow expires

Example:

"2025-11-05T20:00:00Z"

handoff_code
string

One-time code for handoff (internal use)

Example:

"aBcD123EfGh456IjKl789MnOp012QrStUvWxYzAbCdEf"

live_view_url
string<uri>

Browser live view URL for watching the login flow

Example:

"https://live.onkernel.com/abc123xyz"