docs: clarify GitHub OAuth email setup

docs: clarify github oauth email setup
This commit is contained in:
Dream Hunter
2026-04-29 02:04:11 +08:00
committed by GitHub
parent 4e01b4e26f
commit c703082391
6 changed files with 26 additions and 2 deletions

View File

@@ -17,6 +17,18 @@
an email field. If the returned value is not a standard email, use the "Email Format
Transformation" section below.
If you do not want to expose a public GitHub email, use the GitHub email list API instead:
| Field | Value |
|-------|-------|
| User Info URL | `https://api.github.com/user/emails` |
| User Email Key | `$[?(@.primary==true)].email` |
| Scope | `user:email` |
When a `Public email` is selected in the GitHub profile, the default `https://api.github.com/user`
endpoint with `User Email Key = email` can still be used. Merely changing an email from private to
visible without selecting it as the public email can still make the `/user` API return `email: null`.
Reference: [Creating an OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)
### Linux Do