s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All packages
Foundation v0.44.0

@happyvertical/smrt-tenancy

Automatic tenant isolation, context propagation, required or optional scope, and tenant-aware query enforcement.

Source

What it gives you

Automatic tenant isolation, context propagation, required or optional scope, and tenant-aware query enforcement.

  1. 01Required, optional, and global data scopes
  2. 02AsyncLocalStorage context propagation
  3. 03Tenant-safe interceptors across lookups, hydration, search, and collection memory

Scope covers each read path

Tenant context applies to list and get calls, slug lookups, model hydration, vector search, and collection memory. Required models fail closed without a tenant context; system and super-admin contexts are the explicit cross-tenant paths.