Utilities
Every util export of @appfunnel-dev/sdk, generated from the SDK source. Signatures and
descriptions are exact; for how these fit together, see the guides.
isValidEmail
function · util/email.ts
isValidEmail(value: unknown): value is stringCanonical email-shape check, shared by the SDK (checkout email enrichment,
completeUserRegistration) and mirrored from the server’s validation. This is a
cheap syntactic guard — “looks like an address”, not deliverability — so a
half-typed value can’t be treated as a real identity.
The pattern (/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/) is the single source of truth for
“valid enough to identify/charge”: exactly one @, a dot-separated domain, and a
TLD of at least two chars. Keep it identical to the server-side check.
Last updated on