IMPLEMENTATION GUIDE
Authentication & wallets
Sign-in, wallet ownership verification and operation approval serve different purposes. Treat the application session and operation authorization as distinct steps.
Authentication and authorization flow
01Email OTP
Application sign-in
02Passkey
Device and high-trust authentication
03Account
Account lookup / bootstrap
04Authorization
Purpose-bound operation approval
Email OTP creates an application session. It does not by itself prove wallet ownership or authorize a transfer.
Start an application session
sign-in.ts
import { requestEmailOtp, verifyEmailOtp } from "@hazbase/auth";
export async function requestCode(email: string) {
return requestEmailOtp({ email, purpose: "smart_wallet_sign_in" });
}
export async function verifyCode(email: string, code: string) {
return verifyEmailOtp({ email, code, purpose: "smart_wallet_sign_in" });
}Pass email and code from user input. Configure session storage and refresh, allowed origins and passkey behavior for your application.