Skip to main content

providers/yandex

Built-in Yandex integration.

default()​

default(options): OAuthConfig< YandexProfile >

Add Yandex login to your page

Parameters​

β–ͺ options: OAuthUserConfig< YandexProfile >

Returns​

OAuthConfig< YandexProfile >

Example​

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: YANDEX_CLIENT_ID, clientSecret: YANDEX_CLIENT_SECRET })],
})

Resources​

tip

The Yandex provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer

If you think you found a bug in the default configuration, you can open an issue.

Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.


YandexProfile​

Properties​

client_id​

client_id: string;

The ID of the app the OAuth token in the request was issued for. Available in the app properties. To open properties, click the app name.

id​

id: string;

Yandex user's unique ID.

login​

login: string;

User's Yandex login.

psuid​

psuid: string;

Authorized Yandex user ID. It is formed on the Yandex side based on the client_id and user_id pair.

birthday​

birthday?: null | string;

The user's date of birth in YYYY-MM-DD format. Unknown elements of the date are filled in with zeros, such as: 0000-12-23. If the user's date of birth is unknow, birthday will be null

default_avatar_id​

default_avatar_id?: string;

ID of the Yandex user's profile picture. Format for downloading user avatars: https://avatars.yandex.net/get-yapic/<default_avatar_id>/<size>

Example​
"https://avatars.yandex.net/get-yapic/31804/BYkogAC6AoB17bN1HKRFAyKiM4-1/islands-200"
Available sizes:
`islands-small`: 28Γ—28 pixels.
`islands-34`: 34Γ—34 pixels.
`islands-middle`: 42Γ—42 pixels.
`islands-50`: 50Γ—50 pixels.
`islands-retina-small`: 56Γ—56 pixels.
`islands-68`: 68Γ—68 pixels.
`islands-75`: 75Γ—75 pixels.
`islands-retina-middle`: 84Γ—84 pixels.
`islands-retina-50`: 100Γ—100 pixels.
`islands-200`: 200Γ—200 pixels.

default_email​

default_email?: string;

The default email address for contacting the user.

default_phone​

default_phone?: {
id: number;
number: string;
};

The default phone number for contacting the user. The API can exclude the user's phone number from the response at its discretion. The field contains the following parameters: id: Phone number ID. number: The user's phone number.

Type declaration​
id​
id: number;
number​
number: string;

emails​

emails?: string[];

An array of the user's email addresses. Currently only includes the default email address.

is_avatar_empty​

is_avatar_empty?: boolean;

Indicates that the stub (profile picture that is automatically assigned when registering in Yandex) ID is specified in the default_avatar_id field.

real_name​

real_name?: string;

The first and last name that the user specified in Yandex ID. Non-Latin characters of the first and last names are presented in Unicode format.

sex​

sex?: null | "female" | "male";

User's gender. null Stands for unknown or unspecified gender. Will be undefined if not provided by Yandex.