packages/
Auth
Better Auth configuration, browser auth client, email delivery, and authentication helpers.
Signing in is email-based with verification links; Google OAuth is optional. Rooms never take a password or a session cookie over the socket: the HTTP server issues a short-lived presence ticket, and the WebSocket server verifies it during the upgrade before checking room access.
What it owns
- Server-side auth configuration with email verification
- The browser auth client the editor signs in through
- Presence tickets the WebSocket server verifies on upgrade
- Room invitation helpers with email delivery
Files
File list and purposes from the folder README.
| File | Purpose |
|---|---|
src/server.ts | Server auth configuration and verification email. |
src/client.ts | Browser auth client. |
src/presenceTicket.ts | Presence ticket issue and verify helpers. |
src/roomInvitation.ts | Room invitation helpers. |
Dependencies
| Library | Version range | Why it is used here |
|---|---|---|
| bcrypt | ^6.0.0 | Hashes and verifies account passwords. |
| Better Auth | 1.7.7 | Email sign-in, verification mail, and Google OAuth. |
| dotenv | ^17.4.2 | Loads local environment files in development. |
| jsonwebtoken | ^9.0.3 | Signs presence tickets and room invitations. |
Development and tooling (5)
| Library | Version range | Why it is used here |
|---|---|---|
| @types/bcrypt | ^6.0.0 | Type declarations for bcrypt. |
| @types/jsonwebtoken | ^9.0.10 | Type declarations for jsonwebtoken. |
| @types/node | 26.4.1 | Type declarations for Node.js built-ins. |
| TypeScript | 7.0.2 | Compiles the workspace and type-checks every package. |
| Vitest | ^5.0.1 | Runs the unit and regression test suites. |
Dependencies as of commit b0026d9.
Internal packages used
Laying out auth package…
BrowserAPIRealtimeCacheDatabaseShareddurableephemeral
Talks to
Sources: packages/auth/README.md, packages/auth/src/README.md, packages/auth/src/server.ts, packages/auth/src/client.ts, packages/auth/src/presenceTicket.ts, packages/auth/src/roomInvitation.ts (documented at commit b0026d9)