Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.89.0"
".": "0.90.0"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.90.0](https://github.com/kernel/kernel-node-sdk/compare/v0.89.0...v0.90.0) (2026-08-12)


### Features

* Preserve canonical managed auth input metadata ([42d9a61](https://github.com/kernel/kernel-node-sdk/commit/42d9a61609bfee41832ed1f27ef107bb224ab797))
* Support project selection by ID or name ([38f0fae](https://github.com/kernel/kernel-node-sdk/commit/38f0fae987b96d5d908b74d08ad71cea6ed67697))

## [0.89.0](https://github.com/kernel/kernel-node-sdk/compare/v0.88.0...v0.89.0) (2026-08-12)


Expand Down
10 changes: 5 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,10 @@ Types:
Methods:

- <code title="post /org/projects">client.projects.<a href="./src/resources/projects/projects.ts">create</a>({ ...params }) -> Project</code>
- <code title="get /org/projects/{id}">client.projects.<a href="./src/resources/projects/projects.ts">retrieve</a>(id) -> Project</code>
- <code title="patch /org/projects/{id}">client.projects.<a href="./src/resources/projects/projects.ts">update</a>(id, { ...params }) -> Project</code>
- <code title="get /org/projects/{id_or_name}">client.projects.<a href="./src/resources/projects/projects.ts">retrieve</a>(idOrName) -> Project</code>
- <code title="patch /org/projects/{id_or_name}">client.projects.<a href="./src/resources/projects/projects.ts">update</a>(idOrName, { ...params }) -> Project</code>
- <code title="get /org/projects">client.projects.<a href="./src/resources/projects/projects.ts">list</a>({ ...params }) -> ProjectsOffsetPagination</code>
- <code title="delete /org/projects/{id}">client.projects.<a href="./src/resources/projects/projects.ts">delete</a>(id) -> void</code>
- <code title="delete /org/projects/{id_or_name}">client.projects.<a href="./src/resources/projects/projects.ts">delete</a>(idOrName) -> void</code>

## Limits

Expand All @@ -398,8 +398,8 @@ Types:

Methods:

- <code title="get /org/projects/{id}/limits">client.projects.limits.<a href="./src/resources/projects/limits.ts">retrieve</a>(id) -> ProjectLimits</code>
- <code title="patch /org/projects/{id}/limits">client.projects.limits.<a href="./src/resources/projects/limits.ts">update</a>(id, { ...params }) -> ProjectLimits</code>
- <code title="get /org/projects/{id_or_name}/limits">client.projects.limits.<a href="./src/resources/projects/limits.ts">retrieve</a>(idOrName) -> ProjectLimits</code>
- <code title="patch /org/projects/{id_or_name}/limits">client.projects.limits.<a href="./src/resources/projects/limits.ts">update</a>(idOrName, { ...params }) -> ProjectLimits</code>

# Organization

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onkernel/sdk",
"version": "0.89.0",
"version": "0.90.0",
"description": "The official TypeScript library for the Kernel API",
"author": "Kernel <>",
"types": "dist/index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ export interface ClientOptions {

projectID?: string | null | undefined;

project?: string | null | undefined;

/**
* Specifies the environment to use for the API.
*
Expand Down Expand Up @@ -289,6 +291,7 @@ export interface ClientOptions {
export class Kernel {
apiKey: string;
projectID: string | null;
project: string | null;

baseURL: string;
maxRetries: number;
Expand All @@ -309,6 +312,7 @@ export class Kernel {
*
* @param {string | undefined} [opts.apiKey=process.env['KERNEL_API_KEY'] ?? undefined]
* @param {string | null | undefined} [opts.projectID]
* @param {string | null | undefined} [opts.project]
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
* @param {string} [opts.baseURL=process.env['KERNEL_BASE_URL'] ?? https://api.onkernel.com/] - Override the default base URL for the API.
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
Expand All @@ -322,6 +326,7 @@ export class Kernel {
baseURL = readEnv('KERNEL_BASE_URL'),
apiKey = readEnv('KERNEL_API_KEY'),
projectID = null,
project = null,
...opts
}: ClientOptions = {}) {
// Check for Bun runtime in a way that avoids type errors if Bun is not defined
Expand All @@ -345,6 +350,7 @@ export class Kernel {
const options: ClientOptions = {
apiKey,
projectID,
project,
...opts,
baseURL,
environment: opts.environment ?? 'production',
Expand Down Expand Up @@ -393,6 +399,7 @@ export class Kernel {

this.apiKey = apiKey;
this.projectID = projectID;
this.project = project;
}

/**
Expand All @@ -411,6 +418,7 @@ export class Kernel {
fetchOptions: this.fetchOptions,
apiKey: this.apiKey,
projectID: this.projectID,
project: this.project,
...options,
});
client.browserRouteCache = this.browserRouteCache;
Expand Down Expand Up @@ -888,6 +896,7 @@ export class Kernel {
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
...getPlatformHeaders(),
'X-Kernel-Project-Id': this.projectID,
'X-Kernel-Project': this.project,
},
await this.authHeaders(options),
this._options.defaultHeaders,
Expand Down
72 changes: 72 additions & 0 deletions src/resources/auth/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,42 @@ export namespace ManagedAuth {
| 'account'
| 'other';

/**
* Context captured for a choice.
*/
context?: string | null;

/**
* Additional context for the choice.
*/
description?: string | null;

/**
* Display text captured for a choice.
*/
display_text?: string | null;

/**
* Masked phone number or email address shown for an MFA choice.
*/
masked_destination?: string | null;

/**
* Semantic MFA method. Choice id remains the stable identity of the exact option
* selected.
*/
mfa_type?:
| 'sms'
| 'call'
| 'email'
| 'totp'
| 'push'
| 'password'
| 'passkey'
| 'switch'
| 'other'
| null;

/**
* Selector for the visible choice, when available.
*/
Expand Down Expand Up @@ -754,6 +785,11 @@ export namespace ManagedAuth {
*/
type: 'identifier' | 'password' | 'code' | 'totp_code' | 'totp_secret' | 'text';

/**
* Context shown near the field, including a masked code destination.
*/
hint?: string;

/**
* Human-readable label shown to the user.
*/
Expand Down Expand Up @@ -1697,11 +1733,42 @@ export namespace ConnectionFollowResponse {
| 'account'
| 'other';

/**
* Context captured for a choice.
*/
context?: string | null;

/**
* Additional context for the choice.
*/
description?: string | null;

/**
* Display text captured for a choice.
*/
display_text?: string | null;

/**
* Masked phone number or email address shown for an MFA choice.
*/
masked_destination?: string | null;

/**
* Semantic MFA method. Choice id remains the stable identity of the exact option
* selected.
*/
mfa_type?:
| 'sms'
| 'call'
| 'email'
| 'totp'
| 'push'
| 'password'
| 'passkey'
| 'switch'
| 'other'
| null;

/**
* Selector for the visible choice, when available.
*/
Expand Down Expand Up @@ -1774,6 +1841,11 @@ export namespace ConnectionFollowResponse {
*/
type: 'identifier' | 'password' | 'code' | 'totp_code' | 'totp_secret' | 'text';

/**
* Context shown near the field, including a masked code destination.
*/
hint?: string;

/**
* Human-readable label shown to the user.
*/
Expand Down
12 changes: 6 additions & 6 deletions src/resources/projects/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export class Limits extends APIResource {
* @example
* ```ts
* const projectLimits = await client.projects.limits.retrieve(
* 'id',
* 'id_or_name',
* );
* ```
*/
retrieve(id: string, options?: RequestOptions): APIPromise<ProjectLimits> {
return this._client.get(path`/org/projects/${id}/limits`, options);
retrieve(idOrName: string, options?: RequestOptions): APIPromise<ProjectLimits> {
return this._client.get(path`/org/projects/${idOrName}/limits`, options);
}

/**
Expand All @@ -34,12 +34,12 @@ export class Limits extends APIResource {
* @example
* ```ts
* const projectLimits = await client.projects.limits.update(
* 'id',
* 'id_or_name',
* );
* ```
*/
update(id: string, body: LimitUpdateParams, options?: RequestOptions): APIPromise<ProjectLimits> {
return this._client.patch(path`/org/projects/${id}/limits`, { body, ...options });
update(idOrName: string, body: LimitUpdateParams, options?: RequestOptions): APIPromise<ProjectLimits> {
return this._client.patch(path`/org/projects/${idOrName}/limits`, { body, ...options });
}
}

Expand Down
28 changes: 15 additions & 13 deletions src/resources/projects/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,25 @@ export class Projects extends APIResource {
*
* @example
* ```ts
* const project = await client.projects.retrieve('id');
* const project = await client.projects.retrieve(
* 'id_or_name',
* );
* ```
*/
retrieve(id: string, options?: RequestOptions): APIPromise<Project> {
return this._client.get(path`/org/projects/${id}`, options);
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Project> {
return this._client.get(path`/org/projects/${idOrName}`, options);
}

/**
* Update a project's name or status.
*
* @example
* ```ts
* const project = await client.projects.update('id');
* const project = await client.projects.update('id_or_name');
* ```
*/
update(id: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<Project> {
return this._client.patch(path`/org/projects/${id}`, { body, ...options });
update(idOrName: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<Project> {
return this._client.patch(path`/org/projects/${idOrName}`, { body, ...options });
}

/**
Expand All @@ -78,11 +80,11 @@ export class Projects extends APIResource {
*
* @example
* ```ts
* await client.projects.delete('id');
* await client.projects.delete('id_or_name');
* ```
*/
delete(id: string, options?: RequestOptions): APIPromise<void> {
return this._client.delete(path`/org/projects/${id}`, {
delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
return this._client.delete(path`/org/projects/${idOrName}`, {
...options,
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
});
Expand All @@ -93,7 +95,7 @@ export type ProjectsOffsetPagination = OffsetPagination<Project>;

export interface CreateProjectRequest {
/**
* Project name (1-255 Unicode code points)
* Project name (1-255 Unicode code points; cannot contain `/` or `%`)
*/
name: string;
}
Expand Down Expand Up @@ -127,7 +129,7 @@ export interface Project {

export interface UpdateProjectRequest {
/**
* New project name (1-255 Unicode code points)
* New project name (1-255 Unicode code points; cannot contain `/` or `%`)
*/
name?: string;

Expand All @@ -139,14 +141,14 @@ export interface UpdateProjectRequest {

export interface ProjectCreateParams {
/**
* Project name (1-255 Unicode code points)
* Project name (1-255 Unicode code points; cannot contain `/` or `%`)
*/
name: string;
}

export interface ProjectUpdateParams {
/**
* New project name (1-255 Unicode code points)
* New project name (1-255 Unicode code points; cannot contain `/` or `%`)
*/
name?: string;

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.89.0'; // x-release-please-version
export const VERSION = '0.90.0'; // x-release-please-version
4 changes: 2 additions & 2 deletions tests/api-resources/projects/limits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const client = new Kernel({
describe('resource limits', () => {
// Mock server tests are disabled
test.skip('retrieve', async () => {
const responsePromise = client.projects.limits.retrieve('id');
const responsePromise = client.projects.limits.retrieve('id_or_name');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -22,7 +22,7 @@ describe('resource limits', () => {

// Mock server tests are disabled
test.skip('update', async () => {
const responsePromise = client.projects.limits.update('id', {});
const responsePromise = client.projects.limits.update('id_or_name', {});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand Down
6 changes: 3 additions & 3 deletions tests/api-resources/projects/projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('resource projects', () => {

// Mock server tests are disabled
test.skip('retrieve', async () => {
const responsePromise = client.projects.retrieve('id');
const responsePromise = client.projects.retrieve('id_or_name');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -39,7 +39,7 @@ describe('resource projects', () => {

// Mock server tests are disabled
test.skip('update', async () => {
const responsePromise = client.projects.update('id', {});
const responsePromise = client.projects.update('id_or_name', {});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('resource projects', () => {

// Mock server tests are disabled
test.skip('delete', async () => {
const responsePromise = client.projects.delete('id');
const responsePromise = client.projects.delete('id_or_name');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand Down
Loading