providers/yandex
Functionsβ
default()β
Add Yandex login to your page
Exampleβ
import { Auth } from "@auth/core"
import Yandex from "@auth/core/providers/yandex"
const request = new Request("https://example.com")
const response = await Auth(request, {
providers: [Yandex({ clientId: "", clientSecret: "" })],
})
Resourcesβ
Seeβ
- 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.
Signatureβ
default(options: OAuthUserConfig<YandexProfile>): OAuthConfig<YandexProfile>;
Parametersβ
Name | Type |
---|---|
options | OAuthUserConfig <YandexProfile > |
Returnsβ
OAuthConfig
<YandexProfile
>
Interfacesβ
YandexProfileβ
Seeβ
- 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β
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β
string
Yandex user's unique ID.
loginβ
string
User's Yandex login.
psuidβ
string
Authorized Yandex user ID. It is formed on the Yandex side based on the client_id
and user_id
pair.
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?β
"islands-small"
|"islands-34"
|"islands-middle"
|"islands-50"
|"islands-retina-small"
|"islands-68"
|"islands-75"
|"islands-retina-middle"
|"islands-retina-50"
|"islands-200"
ID of the Yandex user's profile picture. The profile picture with this ID can be downloaded via a link that looks like this:
Exampleβ
"https://avatars.yandex.net/get-yapic/31804/BYkogAC6AoB17bN1HKRFAyKiM4-1/islands-200"
default_email?β
string
The default email address for contacting the user.
default_phone?β
object
{
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β
Member | Type |
---|---|
id | number |
number | string |
emails?β
string
[]
An array of the user's email addresses. Currently only includes the default email address.
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?β
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?β
string
User's gender. Possible values: Male: male', Female:
female, Unknown gender:
null`