addEmail()
Creates a user email identifier for the target user id.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function addEmail(userId: string, email: string) { const client = await wachtClient(); return client.users.addEmail(userId, { email });}Signature
function addEmail( userId: string, request: AddEmailRequest,): Promise<UserEmail>Parameters
›userId: string;
userId: string;Target user id.
›email: string;
email: string;Email address to attach.
›verification_strategy?: VerificationStrategy | undefined;
verification_strategy?: VerificationStrategy | undefined;Optional verification strategy override.
Return value
›id?: string | undefined;
id?: string | undefined;Email record id.
›email?: string | undefined;
email?: string | undefined;Stored email value.
›is_primary?: boolean | undefined;
is_primary?: boolean | undefined;Whether this is the primary email.
›verified?: boolean | undefined;
verified?: boolean | undefined;Whether the email is verified.
Behavior
- Wraps the corresponding backend endpoint for this capability.
- Use the returned payload as canonical backend state for follow-up operations.