ContactChannel
ContactChannel
represents a user’s contact information, such as an email address or phone number. Some auth methods, like OTP/magic link or password, use contact channels for authentication.
On this page:
ContactChannel
Basic information about a contact channel, as seen by a user themselves.
Usually obtained by calling user.[list|use]ContactChannels()
.
Table of Contents
contactChannel.id
The id of the contact channel as a string
.
Type Definition
contactChannel.value
The value of the contact channel. If type is "email"
, this is an email address.
Type Definition
contactChannel.type
The type of the contact channel. Currently always "email"
.
Type Definition
contactChannel.isPrimary
Indicates whether the contact channel is the user’s primary contact channel. If an email is set to primary, it will be the value on the user.primaryEmail
field.
Type Definition
contactChannel.isVerified
Indicates whether the contact channel is verified.
Type Definition
contactChannel.usedForAuth
Indicates whether the contact channel is used for authentication. If set to true
, the user can use this contact channel with OTP or password to sign in.
Type Definition
contactChannel.sendVerificationEmail()
Sends a verification email to this contact channel. Once the user clicks the verification link in the email, the contact channel will be marked as verified.
Parameters
None.
Returns
Promise<void>
Signature
Examples
contactChannel.update(options)
Updates the contact channel. After updating the value, the contact channel will be marked as unverified.
Parameters
An object containing properties for updating.
Returns
Promise<void>
Signature
Examples
contactChannel.delete()
Deletes the contact channel.
Parameters
None.
Returns
Promise<void>
Signature
Examples
ServerContactChannel
Like ContactChannel
, but includes additional methods and properties that require the SECRET_SERVER_KEY
.
Usually obtained by calling serverUser.[list|use]ContactChannels()
.
Table of Contents
serverContactChannel.update(options)
Updates the contact channel.
This method is similar to the one on ContactChannel
, but also allows setting the isVerified
property.
Parameters
An object containing properties for updating.
Returns
Promise<void>