Email verification is a security feature that requires users to verify their email address before they can sign in to your application. It is enabled by default.
Users signing in with Magic Auth, Google OAuth, Apple OAuth, or SSO are automatically verified. For other authentication methods, an email verification flow is required to confirm that the user’s email address belongs to them.
const emailVerification = { object: 'email_verification', id: 'email_verification_01HYGGEB6FYMWQNWF3XDZG7VV3', userId: 'user_01HWWYEH2NPT48X82ZT23K5AX4', email: 'marcelina.davis@example.com', expiresAt: '2021-07-01T19:07:33.155Z', code: '123456', createdAt: '2021-06-25T19:07:33.155Z', updatedAt: '2021-06-25T19:07:33.155Z', };
interface EmailVerificationGet the details of an existing email verification code that can be used to send an email to a user for verification.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const emailVerification = await workos.userManagement.getEmailVerification( 'email_verification_01HYGGEB6FYMWQNWF3XDZG7VV3', );