User
object holds all the information for a user of your application and provides a set of methods to manage their account.User
objects hold profile data like their name, a profile image and a set of metadata that can be used internally to store arbitrary information. The metadata are split into public and private. Both types are set from the Backend API, but public metadata can be accessed from the Frontend API and Backend API.User
object to help retrieve and update user information and authentication status.externalAccount.verification.status == 'verified'
. The User
object also offers 2 getters that perform this filtering: verifiedExternalAccounts
& unverifiedAccounts
.unsafeMetadata
attribute in the SignUp object. The value of that field will be automatically copied to the user's unsafe metadata once the sign up is complete.createEmailAddress(params: CreateEmailAddressParams) => Promise<EmailAddressResource>
CreateEmailAddressParams
params object:createPhoneNumber(phoneNumber: CreatePhoneNumberParams) => Promise<PhoneNumberResource>
CreatePhoneNumberParams
params object:Promise
which resolves with a PhoneNumber
objectcreateExternalAccount: ({ strategy, redirect_url }: { strategy: OAuthStrategy; redirect_url?: string; }) => Promise<ExternalAccountResource>
oauth_facebook
, oauth_github
, etcExternalAccount
objectstate
of the returned ExternalAccount will be unverified
. To initiate the connection with the external provider one should redirect to the externalAccount.verification.externalVerificationRedirectURL
contained in the result of createExternalAccount
.user.externalAccounts
the entry that corresponds to the requested strategy:externalAccount.verification.status
should be verified
externalAccount.verification.status
will not be verified
and the externalAccount.verification.error
will contain the error encountered so that you can present corresponding feedback to the usergetSessions() => Promise<SessionWithActivities[]>
Promise
which resolves to an array of SessionWithActivities
objects.getToken(service: JWTService, options?: GetUserTokenOptions) => Promise<string>
Promise
that resolves to a string
. The string is the user's token for the provided integration service.setProfileImage(params: SetProfileImageParams) => Promise<ImageResource>
SetProfileImageParams
params object:twoFactorEnabled() => boolean
true
when the user has enabled 2-factor authentication, false
otherwise.update(params: UpdateUserParams) => Promise<UserResource>
Promise
which resolves to a User
object.verified
.verified
.clerk | firebase | hasura
facebook | github | google | hubspot | tiktok | gitlab | discord | twitter | twitch | linkedin | dropbox | bitbucket | microsoft | notion