NewWacht Bench is live — AI-assisted development for Wacht

setOAuthScopeMapping()

Configures backend permission mapping for one OAuth scope.

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 setScopeMapping(oauthAppSlug: string, scope: string) {  const client = await wachtClient();  return client.oauth.setOAuthScopeMapping(oauthAppSlug, scope, {    permission: 'users:read',  });}

Signature

function setOAuthScopeMapping(  oauthAppSlug: string,  scope: string,  request: SetOAuthScopeMappingRequest,): Promise<OAuthApp>

SetOAuthScopeMappingRequest

oauthAppSlug: string;
OAuth app slug.
scope: string;
OAuth/skills scope key for the operation.
request: SetOAuthScopeMappingRequest;
Request payload object sent to the backend API.
permission?: string | undefined;
permission value used by this request.

Return value

slug?: string | undefined;
OAuth app slug.
name?: string | undefined;
OAuth app display name.
supported_scopes?: string[] | undefined;
Configured supported scope names.
allow_dynamic_client_registration?: boolean | undefined;
Whether dynamic client registration is enabled.

On this page