Setup & Installation
What This Skill Does
Adds two-factor authentication to Better Auth apps via TOTP authenticator apps, email/SMS OTP codes, and backup codes. Handles the full 2FA lifecycle: enabling, verifying during sign-in, trusting devices, and disabling. Backup codes, TOTP secrets, and OTP tokens can each be stored encrypted at rest.
Implementing 2FA from scratch means writing your own TOTP logic, OTP delivery, backup code generation, trusted device cookies, and rate limiting — this plugin handles all of it as a single Better Auth configuration block.
When to use it
- Adding TOTP authenticator app support to a Better Auth sign-in flow
- Sending email or SMS one-time codes as a second factor during login
- Generating and displaying backup codes when users set up 2FA
- Skipping 2FA prompts for 30 days on a user's personal device
- Disabling 2FA for a user account after password confirmation