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.

Swift: Verify and log in through OTP

Parameters

Examples

Verify Sms One-Time Password (OTP)

let session = try await supabase.auth.verifyOTP(
  phone: "+13334445555",
  token: "123456",
  type: .sms
)

Verify Signup One-Time Password (OTP)

let result = try await supabase.auth.verifyOTP(
  email: "example@example-email.com",
  token: "123456",
  type: .signup
)

Verify Email Auth (Token Hash)

switch try await supabase.auth.verifyOTP(tokenHash: tokenHash, type: .emailChange) {
case .signedIn(let session):
  print(session.user.email ?? "")
case .emailChangePending(let message):
  print(message)
}