Types
import type {
AppleCredential,
AppleCredentialState,
AppleFullName,
AppleRealUserStatus,
AppleSignInOptions,
AppleSignInScope,
} from 'nitro-apple-signin'
| Type | Kind | Used by |
|---|---|---|
AppleSignInOptions | interface | signIn(options?) |
AppleSignInScope | union | AppleSignInOptions.scopes |
AppleCredential | interface | Resolved by signIn |
AppleFullName | interface | AppleCredential.fullName |
AppleRealUserStatus | union | AppleCredential.realUserStatus |
AppleCredentialState | union | Resolved by getCredentialState |
AppleSignInOptions
| Field | Type | Description |
|---|---|---|
scopes? | AppleSignInScope[] | The data to ask for. Defaults to none: Apple then returns only the user ID and tokens. |
nonce? | string | A random, single-use string that ties the ID token to this request. Pass the raw value: it is hashed with SHA-256 before it goes to Apple, and the token's nonce claim holds that hash. Firebase and Supabase expect the raw value. |
state? | string | An opaque value returned unchanged in AppleCredential.state. |
AppleSignInScope
type AppleSignInScope = 'fullName' | 'email'
| Value | Fills |
|---|---|
fullName | AppleCredential.fullName |
email | AppleCredential.email, possibly an Apple private relay address |
AppleCredential
The credential Apple issues when a user signs in.
| Field | Type | Description |
|---|---|---|
user | string | The stable user identifier, the sub claim of the ID token. The same on every device signed in with the same Apple ID for apps of one developer team. |
identityToken | string | The OpenID Connect ID token (JWT). Verify it on your backend against Apple's public keys. |
authorizationCode | string | A short-lived, single-use code your backend exchanges with Apple for refresh tokens. |
email? | string | With the email scope, on the user's first sign-in only. May be an @privaterelay.appleid.com address. |
fullName? | AppleFullName | With the fullName scope, on the user's first sign-in only. |
realUserStatus | AppleRealUserStatus | Apple's guess whether the user is a real person. |
state? | string | The state passed in AppleSignInOptions. |
AppleFullName
The name a user shared with this app. Every field is optional.
| Field | Type | Description |
|---|---|---|
givenName? | string | The given (first) name. |
middleName? | string | The middle name. |
familyName? | string | The family (last) name. |
nickname? | string | The nickname. |
namePrefix? | string | The name prefix, such as Dr.. |
nameSuffix? | string | The name suffix, such as Jr.. |
AppleRealUserStatus
type AppleRealUserStatus = 'likelyReal' | 'unknown' | 'unsupported'
| Value | Meaning |
|---|---|
likelyReal | The user appears to be a real person. |
unknown | Apple cannot tell; treat the user like any other. |
unsupported | The device cannot tell. Apple reports a status only on the first sign-in. |
AppleCredentialState
type AppleCredentialState = 'authorized' | 'revoked' | 'notFound' | 'transferred'
| Value | Meaning |
|---|---|
authorized | The user is signed in. |
revoked | The user stopped using Apple ID with this app; sign them out. |
notFound | The user never signed in to this app with this Apple ID, or the device has no Apple ID. |
transferred | The app moved to another developer team; migrate the user's identifier. |