Kind: Service
Source: Pams/API/Pams.API/Pams.API.csproj (line 1)
Part of: Pams
NuGet package dependency
SaasKit.Multitenancy is a NuGet package reference in Pams.API.csproj that provides multitenancy support for the API project. It resolves tenant context during request handling so API components can apply tenant-specific configuration and data access.
Diagram
mermaidsequenceDiagram participant Client participant API as Pams API participant Multitenancy as SaasKit.Multitenancy participant Endpoint as API Endpoint Client->>API: Request with tenant identifier API->>Multitenancy: Resolve tenant context Multitenancy-->>API: Tenant context API->>Endpoint: Process request with tenant context Endpoint-->>Client: Tenant-scoped response
Usage
tsconst response = await fetch("/api/orders", {
headers: {
"X-Tenant-ID": "tenant-a",
Authorization: `Bearer ${accessToken}`,
},
});
if (!response.ok) {
throw new Error("Unable to load orders");
}
const orders = await response.json();
console.log(orders);
AI Coding Instructions
- Keep tenant resolution in the API request pipeline before tenant-dependent endpoints and services run.
- Pass tenant context through existing application abstractions rather than reading request headers directly in business logic.
- Check how
Pams.API.csprojreferences SaasKit.Multitenancy before changing package versions or tenant configuration. - Treat tenant identifiers as request input and validate them before selecting tenant-specific resources.
Was this page helpful?