providers/yandex
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β
- Yandex - Creating an OAuth app
- Yandex - Manage OAuth apps
- Yandex - OAuth documentation
- Learn more about OAuth
- Source code
The Yandex provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
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β
- Getting information about the user
- Access to email address
- Access to the user's profile picture
- Access to the date of birth
- Access to login, first name, last name, and gender
- Access to the phone number
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?:
object
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.