Login / Logout
Authenticate customers and manage sessions.
Updated
On this page
Login with OTP
The primary login method is OTP (one-time password via email). This works for both new and existing customers:
import dash from "@/lib/dash"
// Step 1: Request OTP
await dash.auth.requestOTP("customer@example.com")
// Step 2: Customer enters the code from their email
const { customer, access_token } = await dash.auth.verifyOTP({
email: "customer@example.com",
code: "384710",
})