Skip to content

Request Provider Auth

Initiates an OAuth login flow, returning the provider's authentication URL.

Usage

Node.js / Next.js / Express.js

const { url } = await provider.auth.requestProviderAuth('google');

Usage Note: You should redirect the user’s browser to the returned url.

Arguments

NameTypeDescription
provider'google' | 'github'Required. The OAuth provider to use.

Response

Type: Promise<{ url: string }>

Returns an object containing the provider’s redirect URL.

PropertyTypeDescription
urlstringThe URL to redirect the user to (e.g., accounts.google.com…).

Errors

  • PROVIDER_NOT_CONFIGURED: The Google (or Github) provider is not enabled.
  • UNKNOWN_ERROR: An unknown error has occured.