Auth
Zero-dependency authentication, user management, and notification system for SvelteKit. JWT sessions, WebAuthn passkeys, push notifications, and pre-built UI — all powered by Web Crypto API.
@urbicon-ui/auth provides everything you need for auth in a SvelteKit app: session
management, registration with invitation gates, password reset flows, passkey login, real-time notifications,
and push — with zero runtime dependencies.
All UI components use @urbicon-ui/blocks primitives, support unstyled / slotClasses / snippet overrides, and auto-detect locale
from the @urbicon-ui/i18n context.
Architecture
Each auth flow has two sides: a UI component (client) and a handler factory (server). The UI components send fetch requests to
your SvelteKit API routes. The handler factories create those endpoints with all security built
in.
| UI Component | Server Handler |
|---|---|
| LoginPage | createLoginHandler |
| RegisterPage | createRegisterHandler |
| ForgotPasswordPage | createForgotPasswordHandler |
| ResetPasswordPage | createResetPasswordHandler |
| VerifyEmailPage | createVerifyEmailHandler |
| PasskeyManager | createPasskey*Handler |
| InvitationManager | createInvitationHandlers |
| NotificationListener | createStreamHandler |
All server handlers are imported from @urbicon-ui/auth/server. Database access is
abstracted via the Adapter pattern — a Prisma adapter is included, custom adapters implement
the repository interfaces.
Auth Pages
LoginPage
RegisterPage
ForgotPasswordPage
ResetPasswordPage
VerifyEmailPage
Management
InvitationManager
PasskeyManager
AccountSettings
SessionManager
TwoFactorManager
Notifications
Setup Guide
Integration requires three steps: configure dependencies, create API routes, and add UI pages.
1. Configure auth dependencies
2. Add the SvelteKit hook
The handle hook validates sessions, protects routes, adds CSRF and security headers.
3. Create API route handlers
Each UI component expects a corresponding API endpoint. The handler factories include all validation, hashing, rate limiting, and security.
4. Add UI pages
Components auto-detect locale from @urbicon-ui/i18n. No t prop needed
when the i18n context is set up.