Skip to main content
Urbicon UI

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 ComponentServer Handler
LoginPagecreateLoginHandler
RegisterPagecreateRegisterHandler
ForgotPasswordPagecreateForgotPasswordHandler
ResetPasswordPagecreateResetPasswordHandler
VerifyEmailPagecreateVerifyEmailHandler
PasskeyManagercreatePasskey*Handler
InvitationManagercreateInvitationHandlers
NotificationListenercreateStreamHandler

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

Management

Notifications

Setup Guide

Integration requires three steps: configure dependencies, create API routes, and add UI pages.

1. Configure auth dependencies

Loading...
Loading syntax highlighting...

2. Add the SvelteKit hook

The handle hook validates sessions, protects routes, adds CSRF and security headers.

Loading...
Loading syntax highlighting...

3. Create API route handlers

Each UI component expects a corresponding API endpoint. The handler factories include all validation, hashing, rate limiting, and security.

Loading...
Loading syntax highlighting...

4. Add UI pages

Components auto-detect locale from @urbicon-ui/i18n. No t prop needed when the i18n context is set up.

Loading...
Loading syntax highlighting...