updateDeploymentRestrictions()
Patches restriction controls such as allow/block lists, sign-up mode, and session policy fields.
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 updateRestrictions() { const client = await wachtClient(); await client.settings.updateDeploymentRestrictions({ sign_up_mode: 'waitlist', block_disposable_emails: true, });}Signature
function updateDeploymentRestrictions( request: DeploymentRestrictionsUpdates,): Promise<void>DeploymentRestrictionsUpdates
›allowlist_enabled?: boolean | undefined;
allowlist_enabled?: boolean | undefined;Enable allowlist enforcement.
›blocklist_enabled?: boolean | undefined;
blocklist_enabled?: boolean | undefined;Enable blocklist enforcement.
›block_subaddresses?: boolean | undefined;
block_subaddresses?: boolean | undefined;Block plus-address email variants.
›block_disposable_emails?: boolean | undefined;
block_disposable_emails?: boolean | undefined;Block disposable email providers.
›block_voip_numbers?: boolean | undefined;
block_voip_numbers?: boolean | undefined;Block VOIP phone numbers.
›country_restrictions?: CountryRestrictions | undefined;
country_restrictions?: CountryRestrictions | undefined;Country filtering object.
›allowlist?: string[] | undefined;
allowlist?: string[] | undefined;Allowed country ISO codes.
›blocklist?: string[] | undefined;
blocklist?: string[] | undefined;Blocked country ISO codes.
›banned_keywords?: string[] | undefined;
banned_keywords?: string[] | undefined;Blocked keyword list.
›allowlisted_resources?: string[] | undefined;
allowlisted_resources?: string[] | undefined;Explicit allowlisted resources.
›blocklisted_resources?: string[] | undefined;
blocklisted_resources?: string[] | undefined;Explicit blocklisted resources.
›sign_up_mode?: 'public' | 'restricted' | 'waitlist' | undefined;
sign_up_mode?: 'public' | 'restricted' | 'waitlist' | undefined;Signup mode policy.
›waitlist_collect_names?: boolean | undefined;
waitlist_collect_names?: boolean | undefined;Whether waitlist form collects names.
›multi_session_support?: MultiSessionSupport | undefined;
multi_session_support?: MultiSessionSupport | undefined;Multi-session policy object.
›enabled?: boolean | undefined;
enabled?: boolean | undefined;Whether multiple concurrent sessions are allowed.
›max_sessions_per_user?: number | undefined;
max_sessions_per_user?: number | undefined;Max concurrent sessions per user.
›session_token_lifetime?: number | undefined;
session_token_lifetime?: number | undefined;Session token lifetime (seconds).
›session_validity_period?: number | undefined;
session_validity_period?: number | undefined;Session validity duration (seconds).
›session_inactive_timeout?: number | undefined;
session_inactive_timeout?: number | undefined;Inactive timeout (seconds).
Behavior
- Applies a partial update and returns the server-side updated resource.
- Treat omitted optional fields as unchanged unless explicitly documented otherwise.
Examples
Enable waitlist signup mode
import { wachtClient } from '@wacht/nextjs/server';export async function setWaitlistMode() { const client = await wachtClient(); await client.settings.updateDeploymentRestrictions({ sign_up_mode: 'waitlist', waitlist_collect_names: true, });}