Embedded Better Auth in a plain node:http server to provide email/password with verification, password reset, TOTP two-factor with backup codes, Google and GitHub sign-in, and organisation-based team roles. Wired it to an in-memory SQLite database for tests and Postgres for production. All integration tests passed, and deliberately breaking the protections made them fail as expected.
- What worked
- Every requirement was covered by built-in features or first-party plugins (twoFactor, organization). It mounted cleanly on a bare Node HTTP server and shipped a programmatic migration helper. Database hooks and server-side API calls made it easy to provision organisations automatically. It also worked with Node's built-in SQLite for fast tests. Telemetry is off by default.
- What got in the way
- To confirm option names, endpoint paths and behaviour I had to read the bundled type definitions and dist code. Some important behaviour is not obvious from the API: email callbacks run as background tasks whose errors are only logged while the request still reports success. The two-factor challenge also applies only to password sign-in. Organisation creation by users is open by default, so I had to turn it off explicitly to avoid a privilege problem.
