Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Auth.js · Const

Patreon

Patreon is a built-in Auth.js OAuth provider. Configure it with Patreon credentials and add the resulting provider configuration to Auth.js.

How it works

The Patreon provider is a built-in OAuth integration. Add it to Auth.js with a client ID and secret; Auth.js supplies Patreon’s default OAuth configuration and returns an OAuth provider configuration that can be used by the request handler.

Syntax

function default<P extends PatreonProfile>(options): OAuthConfig<P>

Parameters

NameTypeDescription
optionsOAuthUserConfig<P>OAuth provider options, including the Patreon client ID and client secret.

Returns

OAuthConfig<P>

Key points

  • Auth.js includes Patreon as a built-in integration, so applications can add it through the official provider package rather than implementing the OAuth flow themselves.
  • The provider factory is intended to add Patreon sign-in to an application.
  • Register the Patreon callback endpoint using the /api/auth/callback/patreon path on the application’s origin.
  • The setup page names AUTH_PATREON_ID and AUTH_PATREON_SECRET as the environment variables for Patreon credentials.
  • Pass the Patreon client ID and client secret when calling the provider factory in an Auth.js Core configuration.

Common mistakes

  • The provider uses OAuth 2 assumptions by default; override the built-in configuration when your use case requires different settings.

Example: Configure Patreon with Auth.js Core

import { Auth } from "@auth/core"
import Patreon from "@auth/core/providers/patreon"

const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Patreon({
      clientId: process.env.AUTH_PATREON_ID,
      clientSecret: process.env.AUTH_PATREON_SECRET,
    }),
  ],
})

Create the Auth.js request handler with the Patreon provider and credentials supplied through environment variables.

When to use it

Patreon social login

An application needs users to sign in with Patreon accounts.

Auth.js Core setup

A Core-based Auth.js deployment needs a preconfigured Patreon OAuth integration.

Customized OAuth configuration

The standard provider settings do not fit a deployment’s OAuth requirements.

Interview questions

QHow do you configure Patreon in Auth.js Core?

Import the built-in provider and include its configured result in the Auth.js providers array. Pass the Patreon client ID and client secret through the provider options.

Follow-up: How can the defaults be changed? Use the documented customization approach for a built-in OAuth provider and override the provider configuration for the specific use case.

QWhat callback URL does the Patreon provider use?

The provider callback URL is https://example.com/api/auth/callback/patreon. The Patreon application must be configured to redirect to the corresponding deployment URL.

Follow-up: What must change for another deployment? Replace example.com with the application’s actual origin while retaining the /api/auth/callback/patreon path.

QWhat types define the Patreon provider API?

The provider function accepts OAuthUserConfig<P> and returns OAuthConfig<P>, where P extends PatreonProfile. The profile type exposes string fields including email, nickname, picture, and sub.

Follow-up: What is the purpose of the generic profile type? It allows the provider configuration and returned OAuth configuration to preserve a more specific Patreon profile shape.

  • PatreonProfile
  • OAuthConfig
  • OAuthUserConfig
  • customizing a built-in OAuth provider

Source: Auth.js | Patreon. Checked 2026-10-15.