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

Auth.js · Const

Yandex

Yandex is a built-in Auth.js OAuth provider. Configure it with a Yandex client ID and client secret, then include it in the Auth.js providers list.

How it works

The Yandex provider is a built-in OAuth configuration for Auth.js. Add it to the providers list and supply the Yandex application client ID and secret; Auth.js then uses the provider's defaults and handles the OAuth flow through the configured callback URL.

Syntax

Yandex(options): OAuthConfig<YandexProfile>

Parameters

NameTypeDescription
optionsOAuthUserConfig<YandexProfile>OAuth configuration options for the Yandex provider, including the application credentials.

Returns

OAuthConfig<YandexProfile>

Key points

  • Use the Yandex provider factory to add Yandex sign-in to an Auth.js application.
  • Pass the OAuth client ID and client secret when creating the provider configuration.
  • The provider can obtain profile information from Yandex during authentication.
  • Yandex authentication can provide the user’s email address.
  • The Yandex profile includes access to the user’s profile image.

Common mistakes

  • Register this callback URL with the Yandex application, adapting the origin and path to your deployment.

Example: Configure Yandex authentication

import { Auth } from "@auth/core"
import Yandex from "@auth/core/providers/yandex"

const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Yandex({
      clientId: process.env.YANDEX_CLIENT_ID!,
      clientSecret: process.env.YANDEX_CLIENT_SECRET!,
    }),
  ],
})

Creates an Auth.js request handler configured with Yandex OAuth credentials.

When to use it

Yandex social login

Users need to sign in with Yandex accounts instead of creating a local password.

Import Yandex profile data

An application needs profile and contact data supplied by Yandex OAuth.

Multi-provider authentication

A service supports several OAuth providers through one Auth.js configuration.

Interview questions

QHow do you add Yandex login to Auth.js?

Use the built-in Yandex provider and pass it in the Auth.js providers array. Configure it with the Yandex application’s clientId and clientSecret.

Follow-up: How would you change a provider default? Use the documented built-in OAuth-provider customization mechanism and override only the required option.

QWhat callback URL does the Yandex provider use?

The callback endpoint is the application origin followed by /api/auth/callback/yandex. That URL must be configured for the Yandex OAuth application.

Follow-up: What should change for another deployment? Replace the example origin with the deployed application’s origin while retaining the provider-specific callback suffix.

QWhat are the Yandex provider’s parameter and return types?

The provider factory accepts OAuthUserConfig<YandexProfile> and returns OAuthConfig<YandexProfile>. The configuration therefore combines OAuth provider options with the Yandex profile type.

Follow-up: Why is the profile type useful? It describes the Yandex-specific user data available when mapping the provider response.

  • YandexProfile
  • OAuthUserConfig
  • OAuthConfig
  • Auth
  • customizing a built-in OAuth provider

Source: Yandex - Auth.js. Checked 2026-10-15.