NewWacht Bench is live — AI-assisted development for Wacht

upsertSocialConnection()

Upserts provider configuration for deployment social login.

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 upsertConnection() {  const client = await wachtClient();  return client.settings.upsertSocialConnection({    provider: 'google_oauth',    enabled: true,    credentials: {      client_id: '...',      client_secret: '...',      redirect_uri: 'https://example.com/auth/google/callback',      scopes: ['openid', 'email', 'profile'],    },  });}

Signature

function upsertSocialConnection(  connection: UpsertSocialConnectionRequest,): Promise<SocialConnection>

UpsertSocialConnectionRequest

provider?: SocialConnectionProvider | undefined;
Provider key to create/update.
enabled?: boolean | undefined;
Enable/disable provider.
user_defined_scopes?: string[] | undefined;
Requested provider scopes.
credentials?: SocialConnectionCredentials | undefined;
Provider credential object.
client_id?: string | undefined;
OAuth client id from provider console.
client_secret?: string | undefined;
OAuth client secret from provider console.
redirect_uri?: string | undefined;
OAuth callback/redirect URI.
scopes?: string[] | undefined;
Requested OAuth scopes.

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