Establish safe boundaries
Enforce tenant isolation, predictable API contracts, authorization, and auditability inside your application.
Start with tenancy
Compose tenant isolation, audit logging, background jobs, and webhook delivery in your own application.
Supported packages have active compatibility coverage and maintained documentation. Preview packages are usable, but their APIs and operating contracts are still evolving. Status does not replace the version number or changelog when assessing upgrade risk.
PostgreSQL TEXT/UUID RLS, tenant-scoped Prisma transactions, live audits, and validated RPC tenant context.
Supported · v0.16.0safe-responseAPI response wrapper with Swagger integration, field selection, error catalogs, and i18n support.
Supported · v0.3.2paginationPrisma 7 cursor, keyset, and offset pagination with filters, sorting, and Swagger helpers.
Supported · v0.7.6soft-deletePrisma soft-delete with relation filters, cascade, bulk restore, purge, events, and optional atomic audit lifecycles.
Preview · v1.0.0idempotencyHTTP Idempotency-Key handling with hashed request identities, ownership leases, and response replay across memory, Redis, or PostgreSQL.
Supported · v0.9.0audit-logRecord who changed what with managed transactions, optional atomic PostgreSQL Outbox delivery, and PostgreSQL or SQL Server history queries.
Preview · v0.4.0api-keysTenant-scoped API keys with Prisma 5/6/7 storage, request authorization, atomic rotation, and safe management summaries.
Supported · v0.6.0feature-flagDB-backed feature flags with cache adapters, Admin API, rollouts, and tenant overrides.
Supported · v0.2.2rbacTyped tenant-aware permissions, identity-source reconciliation, HTTP guards, Prisma 5/6/7 storage, and final decision audits.
Preview · v0.4.1outboxPrisma transactional outbox with renewable leases, persisted retries, tenant admin scopes, and broker publishing.
Preview · v0.2.0inboxTransactional inbox for NestJS, Prisma, and PostgreSQL with durable event deduplication, atomic database effects, retries, and replay.
Preview · v0.4.2jobsTyped jobs with bounded tenant-fair local workers, BullMQ producer/worker roles, Redis dedupe, retention, and outbox publishing.
Supported · v0.13.3webhookIdempotent HMAC-signed delivery with Prisma 5/6/7 repositories, retry/replay controls, worker metrics, and retention.
Preview · v0.3.0data-subjectTenant-scoped export and verified erasure with shared policies, signed previews, durable recovery, and paged jobs.
Multi-tenant SaaS teams repeatedly implement the same high-risk infrastructure. nestarc provides tested building blocks with explicit compatibility ranges, operational contracts, and documented limitations.
// Scattered across 50+ services, easy to forget, hard to audit
async updateUser(id: string, dto: UpdateUserDto) {
const before = await this.prisma.user.findUnique({ where: { id } });
await this.prisma.$executeRaw`SELECT set_config('app.current_tenant', ${tenantId}, true)`;
const after = await this.prisma.user.update({ where: { id, deletedAt: null }, data: dto });
await this.auditService.log({
action: 'user.update',
targetType: 'User',
targetId: id,
metadata: { before, after },
});
return { success: true, data: after, timestamp: new Date() };
}// PrismaService binds the tenant inside the audit transaction.
async updateUser(id: string, dto: UpdateUserDto) {
return this.prisma.withTenantAuditTransaction((tx) =>
tx.user.update({ where: { id, deletedAt: null }, data: dto }),
);
}Package documentation publishes benchmark setup, compatibility ranges, and known limitations alongside the feature guide. Benchmark results describe specific code paths under documented conditions; they are not universal latency promises or cross-package comparisons.
Static security scanning for MCP server implementations and MCP client configuration files. It is published under the @nestarc scope, but lives separately from the NestJS SaaS module lineup.
Explore mcp-guard →