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

Auth.js · Const

Pinterest

Auth.js provides a built-in Pinterest OAuth provider. Add Pinterest to the providers list and configure AUTH_PINTEREST_ID and AUTH_PINTEREST_SECRET for the standard setup.

How it works

Pinterest is a built-in OAuth 2 provider. Add the provider to Auth.js, define the Pinterest credentials using the expected environment-variable names, and register the generated callback URL in the Pinterest app configuration.

Syntax

Pinterest

Key points

  • Auth.js includes Pinterest as a built-in provider.
  • A Next.js application should register this Pinterest callback endpoint with the Pinterest app.
  • The provider's credentials use these environment-variable names.
  • The integration follows Pinterest's OAuth 2 protocol by default.
  • Basic usage relies on the provider's shipped defaults.

Common mistakes

  • Production use requires standard Pinterest API access rather than trial access.

Example: Configure Pinterest with NextAuth

import NextAuth from "next-auth"
import Pinterest from "next-auth/providers/pinterest"

export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Pinterest],
})

Register the built-in Pinterest provider with Auth.js; credentials are inferred from the Pinterest environment variables.

When to use it

Pinterest social login

Allow users to sign in or register through Pinterest in a Next.js application.

OAuth application integration

Connect a Pinterest developer application to an Auth.js deployment.

Default provider configuration

Use Auth.js's standard Pinterest OAuth behavior without custom provider settings.

Interview questions

QHow do you add Pinterest authentication to a Next.js Auth.js application?

The built-in provider is imported from next-auth/providers/pinterest and added to the providers array. Auth.js can infer its credentials from AUTH_PINTEREST_ID and AUTH_PINTEREST_SECRET.

Follow-up: What callback URL should a Next.js deployment register? Use https://example.com/api/auth/callback/pinterest, replacing the domain with the deployment's domain.

QWhat does the Pinterest provider configure by default?

The provider uses Pinterest's OAuth 2 flow and supplies a default configuration. Passing the provider directly is enough for the standard setup; customization is available when defaults do not fit.

Follow-up: How would you customize the built-in provider? Call Pinterest({...}) with provider options and pass that configured result in the providers array.

QWhich credentials are needed for the Pinterest provider?

Pinterest requires an application ID and secret. Auth.js recognizes the conventional names AUTH_PINTEREST_ID and AUTH_PINTEREST_SECRET, so the provider can be registered without explicitly passing those values.

Follow-up: What changes if environment-variable inference is not used? Pass the credentials explicitly through the provider's configuration options.

  • OAuthConfig
  • PinterestProfile
  • customizing a built-in OAuth provider
  • OAuth providers

Source: Pinterest Provider. Checked 2026-10-15.