Advanced Features
awesome-node-auth provides optional interfaces and hooks for advanced functionality. Every feature is opt-in — only configure what you need.
| Feature | Guide | Description |
|---|---|---|
| Sessions | ISessionStore | External persistence for auditing and admin-level revocation |
| IdP Mode | IdProviderConfig | RS256-signed JWTs + JWKS endpoint — act as a central Identity Provider |
| Roles & Permissions | IRolesPermissionsStore | RBAC — assign roles, permissions, tenant-scoped |
| Multi-Tenancy | ITenantStore | Tenant CRUD, user↔tenant association |
| CSRF Protection | AuthConfig.csrf | Double-submit cookie pattern |
| User Metadata | IUserMetadataStore | Arbitrary per-user key/value data |
| Account Linking | ILinkedAccountsStore | Link multiple OAuth providers to one account |
| Admin Panel | createAdminRouter() | Built-in admin dashboard (HTML UI + REST API) |
| Dynamic Inbound Webhooks | @webhookAction, ActionRegistry, node:vm | Govern and execute JS scripts on inbound webhooks via the admin UI; scripts run with the server's privileges, so only trusted operators may write them |
| Bearer Token | — | Mobile/native clients: token storage, interceptors |
| Mailer (HTTP) | MailerConfig | Built-in HTTP email transport with bilingual templates |
| Email Verification | emailVerificationMode | none / lazy / strict verification enforcement |
| Change Email | — | Two-step email address change with confirmation link |
| Account Deletion | — | DELETE /auth/account + tenant cleanup |
| Custom JWT Claims | buildTokenPayload | Embed tenant IDs, permissions, feature flags in JWT |
| AuthEventBus | AuthEventBus | Central event bus — subscribe to 26 standardised identity events |
| API Keys | ApiKeyService, IApiKeyStore | Machine-to-machine API key authentication with bcrypt hashing |
| AuthTools | AuthTools | Unified entry point for telemetry, SSE, and webhooks |
| SSE | SseManager | Real-time Server-Sent Events streaming by topic |
| Scaling SSE | Redis pub/sub adapter | Broadcast SSE events across multiple instances or a Kubernetes cluster |
| Real-time Decorators | @sseNotify | Fire real-time notifications from any service or store method |
| Webhooks | WebhookSender, IWebhookStore | Outgoing webhooks with HMAC signing and retry |
| Telemetry | ITelemetryStore | Persist and query identity events |
| Swagger / OpenAPI | createToolsRouter() | Auto-generated OpenAPI 3.0 spec + Swagger UI |
| Browser Client | window.AwesomeNodeAuth | Zero-config JS client shipped as auth.js — CSRF, auto-refresh, guards, all auth methods |
| Built-in UI | buildUiRouter() | Server-rendered login/register pages — activation, CSS variables, full customization guide |
| CORS & Dynamic siteUrl | AuthConfig.cors | Cross-domain setups and per-caller siteUrl resolution for emails and redirects |
| Extending Interfaces | BaseUser, BaseTenant, Session | Add custom fields to the base types with full TypeScript safety |