Skip to main content

Types

import type {
AppleCredential,
AppleCredentialState,
AppleFullName,
AppleRealUserStatus,
AppleSignInOptions,
AppleSignInScope,
} from 'nitro-apple-signin'
TypeKindUsed by
AppleSignInOptionsinterfacesignIn(options?)
AppleSignInScopeunionAppleSignInOptions.scopes
AppleCredentialinterfaceResolved by signIn
AppleFullNameinterfaceAppleCredential.fullName
AppleRealUserStatusunionAppleCredential.realUserStatus
AppleCredentialStateunionResolved by getCredentialState

AppleSignInOptions​

FieldTypeDescription
scopes?AppleSignInScope[]The data to ask for. Defaults to none: Apple then returns only the user ID and tokens.
nonce?stringA 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?stringAn opaque value returned unchanged in AppleCredential.state.

AppleSignInScope​

type AppleSignInScope = 'fullName' | 'email'
ValueFills
fullNameAppleCredential.fullName
emailAppleCredential.email, possibly an Apple private relay address

AppleCredential​

The credential Apple issues when a user signs in.

FieldTypeDescription
userstringThe 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.
identityTokenstringThe OpenID Connect ID token (JWT). Verify it on your backend against Apple's public keys.
authorizationCodestringA short-lived, single-use code your backend exchanges with Apple for refresh tokens.
email?stringWith the email scope, on the user's first sign-in only. May be an @privaterelay.appleid.com address.
fullName?AppleFullNameWith the fullName scope, on the user's first sign-in only.
realUserStatusAppleRealUserStatusApple's guess whether the user is a real person.
state?stringThe state passed in AppleSignInOptions.

AppleFullName​

The name a user shared with this app. Every field is optional.

FieldTypeDescription
givenName?stringThe given (first) name.
middleName?stringThe middle name.
familyName?stringThe family (last) name.
nickname?stringThe nickname.
namePrefix?stringThe name prefix, such as Dr..
nameSuffix?stringThe name suffix, such as Jr..

AppleRealUserStatus​

type AppleRealUserStatus = 'likelyReal' | 'unknown' | 'unsupported'
ValueMeaning
likelyRealThe user appears to be a real person.
unknownApple cannot tell; treat the user like any other.
unsupportedThe device cannot tell. Apple reports a status only on the first sign-in.

AppleCredentialState​

type AppleCredentialState = 'authorized' | 'revoked' | 'notFound' | 'transferred'
ValueMeaning
authorizedThe user is signed in.
revokedThe user stopped using Apple ID with this app; sign them out.
notFoundThe user never signed in to this app with this Apple ID, or the device has no Apple ID.
transferredThe app moved to another developer team; migrate the user's identifier.