Connectum API Reference / @connectum/auth / authContextStorage
Variable: authContextStorage
constauthContextStorage:AsyncLocalStorage<AuthContext>
Defined in: packages/auth/src/context.ts:87
Process-wide AsyncLocalStorage for auth context.
Uses globalThis + Symbol.for() to guarantee singleton even when the module is evaluated multiple times (e.g., mixed src/dist imports in dev).
Set by auth interceptors, read by handlers via getAuthContext(). Automatically isolated per async context (request).
