createOAuthApp()
Creates an OAuth app using multipart form fields and returns the created app object.
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 createOAuthApp() { const client = await wachtClient(); return client.oauth.createOAuthApp({ slug: 'my-oauth-app', name: 'My OAuth App', fqdn: 'auth.example.com', });}Signature
function createOAuthApp( request: CreateOAuthAppRequest,): Promise<OAuthApp>CreateOAuthAppRequest
›slug?: string | undefined;
slug?: string | undefined;Unique OAuth app slug.
›name?: string | undefined;
name?: string | undefined;OAuth app display name.
›description?: string | undefined;
description?: string | undefined;Optional OAuth app description.
›fqdn?: string | undefined;
fqdn?: string | undefined;OAuth issuer/domain hostname.
›supported_scopes?: string[] | undefined;
supported_scopes?: string[] | undefined;Supported scope names for this app.
›allow_dynamic_client_registration?: boolean | undefined;
allow_dynamic_client_registration?: boolean | undefined;Allow RFC-style dynamic OAuth client registration.
Return value
›slug?: string | undefined;
slug?: string | undefined;Created OAuth app slug.
›name?: string | undefined;
name?: string | undefined;Created OAuth app display name.
›description?: string | undefined;
description?: string | undefined;Created OAuth app description.
›fqdn?: string | undefined;
fqdn?: string | undefined;Created OAuth issuer/domain hostname.
›supported_scopes?: string[] | undefined;
supported_scopes?: string[] | undefined;Configured supported scope names.
›allow_dynamic_client_registration?: boolean | undefined;
allow_dynamic_client_registration?: boolean | undefined;Whether dynamic registration is enabled.
Behavior
- Creates a deployment-scoped OAuth app with the provided identifiers and metadata.
- The returned app object is the source of truth for subsequent client and grant operations.
Validation expectations
- Use a globally unique slug inside the deployment.
- Provide scope names that match your intended consent and permission mapping model.