NAuthAdapter
Package: @nauth-toolkit/core
Type: Interface
Contract for framework adapters that register middleware/hooks and manage AsyncLocalStorage request context.
- NestJS
- Express
- Fastify
import { NAuthAdapter } from '@nauth-toolkit/nestjs';
import { NAuthAdapter } from '@nauth-toolkit/core';
import { NAuthAdapter } from '@nauth-toolkit/core';
Properties
| Property | Type | Description |
|---|---|---|
name | string (readonly) | Adapter name for logging/debugging (e.g., 'express', 'fastify') |
Methods
| Method | Returns | Description |
|---|---|---|
registerMiddleware(name, handler, options?) | unknown | Register a middleware handler. name is a string identifier (e.g., 'auth'), handler is a NAuthMiddlewareHandler, options is optional MiddlewareOptions. |
registerResponseInterceptor(handler) | unknown | Register a response interceptor for token delivery. handler is a NAuthResponseInterceptorHandler. |
wrapRouteHandler(handler) | unknown | Wrap a route handler to ensure AsyncLocalStorage context is available. |
Related APIs
- NAuthRequest - Request contract
- NAuthResponse - Response contract