NewWacht Bench is live — AI-assisted development for Wacht

updateJwtTemplate()

Patches one JWT template identified by template id.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function updateTemplate(templateId: string) {  const client = await wachtClient();  return client.settings.updateJwtTemplate(templateId, {    token_lifetime: 7200,  });}

Signature

function updateJwtTemplate(  templateId: string,  request: UpdateJwtTemplateRequest,): Promise<JwtTemplate>

UpdateJwtTemplateRequest

templateId?: string | undefined;
Target template id.
name?: string | undefined;
Updated template name.
token_lifetime?: number | undefined;
Updated lifetime in seconds.
allowed_clock_skew?: number | undefined;
Updated clock skew allowance.
custom_signing_key?: CustomSigningKey | undefined;
Updated custom key config.
kid?: string | undefined;
Signing key id.
alg?: string | undefined;
Signing algorithm.
private_key?: string | undefined;
PEM/JWK private signing key material.
template?: Record<string, unknown> | undefined;
Updated claims template.
sub?: string | undefined;
Subject claim template.
role?: string | undefined;
Role/authorization claim template.
metadata?: Record<string, unknown> | undefined;
Additional custom claim object.
tenant_id?: string | undefined;
Example tenant identifier claim.
plan?: string | undefined;
Example plan claim.

Behavior

  • Applies a partial update and returns the server-side updated resource.
  • Treat omitted optional fields as unchanged unless explicitly documented otherwise.

On this page