NewWacht Bench is live — AI-assisted development for Wacht

listOAuthGrants()

Returns grants for a specific OAuth client under one OAuth app.

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 listOAuthGrants(oauthAppSlug: string, oauthClientId: string) {  const client = await wachtClient();  return client.oauth.listOAuthGrants(oauthAppSlug, oauthClientId);}

Signature

function listOAuthGrants(  oauthAppSlug: string,  oauthClientId: string,): Promise<OAuthGrant[]>

Parameters

oauthAppSlug?: string | undefined;
Parent OAuth app slug.
oauthClientId?: string | undefined;
OAuth client id to list grants for.

Return value

id?: string | undefined;
OAuth grant id.
client_id?: string | undefined;
OAuth client id tied to this grant.
subject?: string | undefined;
Subject/user identifier for this grant.
scope?: string | undefined;
Granted scope string.
created_at?: string | undefined;
Grant creation timestamp.
revoked_at?: string | undefined;
Grant revocation timestamp when revoked.

Behavior

  • Returns grants issued for one client within one OAuth app.
  • Each grant entry identifies subject and scope so you can audit active access.

Operational usage

  • Use this method before revocation flows to identify exact grant ids.
  • Treat revoked_at as authoritative when determining active versus revoked grants.

On this page