Purpose & Overview
Enterprise-grade multi-strategy authentication, session management, and identity provider for the Veap Framework.
Core Capabilities#
- Multi-Strategy Authentication: Native credentials with Argon2id / bcrypt hashing, biometric WebAuthn Passkeys (Apple Touch ID, Face ID, Windows Hello, YubiKey), TOTP two-factor authentication, and Google OAuth 2.0 / OpenID Connect SSO.
- Session Lifecycle & Security: High-performance session validation backed by encrypted cookies (
HttpOnly,SameSite=Lax,Secure), request-level deduplication via Reactcache(), and multi-device session invalidation. - Virtual Route Discovery: Automatically discovers and mounts production-ready authentication routes:
/signin,/signup,/forgot-password,/reset-password, and/verify-email. - Pre-Built UI & Server Actions: Accessible, pre-styled client components (
LoginForm,SignUpForm) exported via@veap/auth-plugin/clientalongside type-safe Server Actions under@veap/auth-plugin/actions. - Modular Sub-Plugins: Serves as the primary orchestrator for
@veap/auth-passkey-plugin,@veap/auth-totp-plugin, and@veap/auth-google-pluginvia pluggable login form slots and extensible pipelines.
Installation & Setup
1
Install the package
bash
bun veap add @veap/auth-plugin2
Register in lib/veap.ts (or auto via lib/plugins.gen.ts)
lib/veap.ts
typescript
// lib/veap.ts
import { Application } from "@veap/core/core/server";
import authPlugin from "@veap/auth-plugin";
export const app = Application.configure()
.withDatabase()
.withAuth()
.withPlugins([authPlugin])
.create();
// Verifying authentication in server components, layouts, or actions:
import { getCurrentSession } from "@veap/core/auth/server";
import { redirect } from "next/navigation";
const { session, user } = await getCurrentSession();
if (!session || !user) {
redirect("/signin");
}
// Rendering client login or registration components:
import { LoginForm, SignUpForm } from "@veap/auth-plugin/client";3
Run database migrations
bash
bun run veap migrateKeep in mind
- Requires a 16, 24, or 32-byte ENCRYPTION_KEY (AES-GCM) configured in the runtime environment.
- Provides Extension Points for SSO authentication methods (@veap/auth-google-plugin, @veap/auth-passkey-plugin, @veap/auth-totp-plugin).
- Automatically manages secure cookie sessions with HttpOnly and SameSite protection.
Dependencies
Veap Core
@veap/core (^0.1.0)
Required Veap Plugins
NPM Packages
- zod@^4.4.3
- date-fns@^4.4.0
- lucide-react@^1.27.0
Authors & Maintainers
Veap Core Team
Maintainer
Credits & Acknowledgments
- Lucide Icons: Security and lock icons
Specifications
- License
- MIT
- Type
- plugin
- Status
- official
- Repository
- GitHub →
- Issues
- Report issue →