For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
signInWithOTP() will signup the user instead. To restrict this behavior, set shouldCreateUser to false in the options.verifyOTP(). Pass the URL that a magic link opens to handleRedirect(_:).MessageID? that the SMS provider gave the message.SITE_URL.{{ .Token }} instead of {{ .ConfirmationURL }}.One of `email` or `phone` must be provided.
One of `email` or `phone` must be provided.
`EmailOTPOptions` for an email: `shouldCreateUser`, `userMetadata`, `redirectTo` (the redirect URL embedded in the email link), and `captchaToken`. `PhoneOTPOptions` for a phone: `shouldCreateUser`, `userMetadata`, `channel` (`.sms` or `.whatsapp`), and `captchaToken`. When `shouldCreateUser` or `channel` is `nil`, the server applies its default: it creates the user, and it sends the code by SMS.
try await supabase.auth.signInWithOTP(
email: "example@email.com",
options: EmailOTPOptions(
redirectTo: URL(string: "my-app-scheme://callback")!
)
)
try await supabase.auth.signInWithOTP(phone: "+13334445555")
try await supabase.auth.signInWithOTP(
phone: "+13334445555",
options: PhoneOTPOptions(channel: .whatsapp)
)