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"
}Starts a login flow for the auth connection. Returns immediately with a hosted URL for the user to complete authentication, or triggers automatic re-auth if credentials are stored.
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"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Auth connection ID
Request to start a login flow
Proxy selection. Provide either id or name. The proxy must belong to the caller's org.
Show child attributes
Login flow started
Response from starting a login flow
Auth connection ID
"ma_abc123xyz"
Type of login flow started
LOGIN, REAUTH "LOGIN"
URL to redirect user to for login
"https://auth.kernel.com/login/abc123xyz"
When the login flow expires
"2025-11-05T20:00:00Z"
One-time code for handoff (internal use)
"aBcD123EfGh456IjKl789MnOp012QrStUvWxYzAbCdEf"
Browser live view URL for watching the login flow
"https://live.onkernel.com/abc123xyz"