vendix-multi-tenant-context
CommunityUnify tenant context across requests safely.
Software Engineering#multi-tenant#middleware#NestJS#tenant-isolation#interceptor#AsyncLocalStorage#domain-resolution
AuthorRzyfront
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Vendix's multi-tenant backend requires a reliable per-request tenant context (store_id and organization_id) to be available across the entire execution flow without passing identifiers through every function.
Core Features & Use Cases
- Context Bridge pattern attaches tenant information to the Request object early in the pipeline.
- DomainResolverMiddleware resolves the tenant from hostname or headers to determine store and organization.
- RequestContextInterceptor merges authentication data with domain context and initializes AsyncLocalStorage for downstream components.
- Safe context access via RequestContextService prevents cross-tenant data leakage by not providing static fallbacks when context is missing.
- Use case: a SaaS app serving multiple stores uses per-request tenant data to scope database queries and business rules.
Quick Start
Apply the DomainResolverMiddleware on routes, register the RequestContextInterceptor (globally or per scope), and use RequestContextService to access tenant context in services to scope data access.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: vendix-multi-tenant-context Download link: https://github.com/Rzyfront/Vendix/archive/main.zip#vendix-multi-tenant-context Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.