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.
enrollTOTP(issuer:friendlyName:) and enrollPhone(_:friendlyName:). Each returns the data for that factor type.unverified. Use its id to create a challenge.mfa.challenge().mfa.verify().mfa.challengeAndVerify().mfa.enrollWebAuthn(friendlyName:anchor:) runs the full ceremony and returns the upgraded session (experimental). It is not available on watchOS.let enrollment = try await supabase.auth.mfa.enrollTOTP(
issuer: "optional issuer",
friendlyName: "optional friendly name"
)
// Use the id to create a challenge.
// The challenge can be verified by entering the code generated from the authenticator app.
// The code will be generated upon scanning the qrCode or entering the secret into the authenticator app.
let id = enrollment.id
let qrCode = enrollment.qrCode
let secret = enrollment.secret
let uri = enrollment.uri
let enrollment = try await supabase.auth.mfa.enrollPhone(
"+15555550100",
friendlyName: "Work phone"
)
// Send a code to the phone, then verify it with mfa.verify().
let challenge = try await supabase.auth.mfa.challenge(factorID: enrollment.id)
// @_spi(Experimental) import Supabase
// enrollWebAuthn runs the full ceremony: enroll, challenge, show the passkey sheet, verify.
// A nil anchor uses the app's key window.
let session = try await supabase.auth.mfa.enrollWebAuthn(
friendlyName: "My passkey"
)