Home > Posts Tenant env

Max Heinritz

Tenant env

The tenant environment is a way to isolate data within a tenant for testing. Some tables like users and roles are always “LIVE”, while other tables like shipments and invoices can be operated against in either “LIVE” or “TEST” environments.

Tenant-owned tables can have a tenant_env column specifying their tenant environment. Each ctx defines its tenantEnv. Authorization rules based on ctx limit access to data within one tenant env at a time.

import { Enum, EnumValue } from "@kejistan/enum";

export const TenantEnv = Enum({

export type TenantEnv = EnumValue<typeof TenantEnv>;