> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hexclave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ContactChannel

> Reference for ContactChannel and ServerContactChannel types for user contact information.

`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`](#contactchannel)
- [`ServerContactChannel`](#servercontactchannel)# `ContactChannel`Basic information about a contact channel, as seen by a user themselves.Usually obtained by calling [`user.listContactChannels()`](https://docs.hexclave.com/sdk/types/user#currentuserlistcontactchannels) or [`user.useContactChannels()`](https://docs.hexclave.com/sdk/types/user#currentuserusecontactchannels).## Table of ContentsContactChannel Table of Contents<pre />## Properties

\<details>

\<summary>`contactChannel.id`
          
            
            contactChannel</summary>

      

The ID of the contact channel.

Type Definition

\`typescript declare const id: string; `

\</details>



\<details>

\<summary>`contactChannel.value`
          
            
            contactChannel</summary>

      

The value of the contact channel. If the type is `"email"`, this is an email address.

Type Definition

\`typescript declare const value: string; `

\</details>



\<details>

\<summary>`contactChannel.type`
          
            
            contactChannel</summary>

      

The type of contact channel. Currently this is always `"email"`.

Type Definition

\`typescript declare const type: "email"; `

\</details>



\<details>

\<summary>`contactChannel.isPrimary`
          
            
            contactChannel</summary>

      

Whether the contact channel is the user's primary contact method. If an email is set to primary, it will be the value on `user.primaryEmail`.

Type Definition

\`typescript declare const isPrimary: boolean; `

\</details>



\<details>

\<summary>`contactChannel.isVerified`
          
            
            contactChannel</summary>

      

Whether the contact channel is verified.

Type Definition

\`typescript declare const isVerified: boolean; `

\</details>



\<details>

\<summary>`contactChannel.usedForAuth`
          
            
            contactChannel</summary>

      

Whether the contact channel is used for authentication. If `true`, the user can use this contact channel with OTP or password to sign in.

Type Definition

\`typescript declare const usedForAuth: boolean; `

\</details>

## Methods

\<details>

\<summary>`contactChannel.sendVerificationEmail([options])`
          
            
            contactChannel</summary>

      

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

\**options.callbackUrl** `string`

The URL to redirect to after the user clicks the verification link.

Returns

\`Promise<void>`

Signature

\```typescript theme={null}
declare function sendVerificationEmail(options?: {
  callbackUrl?: string;
}): Promise<void>;
\```

Examples

\```typescript theme={null}
await contactChannel.sendVerificationEmail();
\```

\</details>



\<details>

\<summary>`contactChannel.update(options)`
          
            
            contactChannel</summary>

      

Updates the contact channel. After updating the value, the contact channel will be marked as unverified.

Parameters

\**options.value** `string`

The new value of the contact channel.

\**options.usedForAuth** `boolean`

Whether the contact channel is used for authentication.

\**options.isPrimary** `boolean`

Whether the contact channel is the user's primary contact channel.

Returns

\`Promise<void>`

Signature

\```typescript theme={null}
declare function update(options: {
  value?: string;
  usedForAuth?: boolean;
  isPrimary?: boolean;
}): Promise<void>;
\```

Examples

\```typescript theme={null}
await contactChannel.update({
  value: "new-email@example.com",
  usedForAuth: true,
});
\```

\</details>



\<details>

\<summary>`contactChannel.delete`
          
            
            contactChannel</summary>

      

Deletes the contact channel.

Returns

\`Promise<void>`

Signature

\```typescript theme={null}
declare function delete(): Promise<void>;
\```

Examples

\```typescript theme={null}
await contactChannel.delete();
\```

\</details>

***# `ServerContactChannel`Like `ContactChannel`, but includes additional methods and properties that require the `SECRET_SERVER_KEY`.Usually obtained by calling [`serverUser.listContactChannels()`](https://docs.hexclave.com/sdk/types/user#serveruserlistcontactchannels) or [`serverUser.useContactChannels()`](https://docs.hexclave.com/sdk/types/user#serveruserusecontactchannels).## Table of ContentsServerContactChannel Table of Contents<pre />## Methods

\<details>

\<summary>`serverContactChannel.update(options)`
          
            
            serverContactChannel</summary>

      

Updates the contact channel. This method is similar to the one on `ContactChannel`, but also allows setting the `isVerified` property.

Parameters

\**options.value** `string`

The new value of the contact channel.

\**options.usedForAuth** `boolean`

Whether the contact channel is used for authentication.

\**options.isVerified** `boolean`

Whether the contact channel is verified.

\**options.isPrimary** `boolean`

Whether the contact channel is the user's primary contact channel.

Returns

\`Promise<void>`

Signature

\```typescript theme={null}
declare function update(options: {
  value?: string;
  usedForAuth?: boolean;
  isVerified?: boolean;
  isPrimary?: boolean;
}): Promise<void>;
\```

Examples

\```typescript theme={null}
await serverContactChannel.update({
  value: "new-email@example.com",
  usedForAuth: true,
  isVerified: true,
});
\```

\</details>

