Skip to main content

Tenarium

The open-source tenant control plane for multi-tenant SaaS: tenant lifecycle, plans and usage, users and single sign-on, and a reliable event log that plugins build on.

What Tenarium does

One service owns your tenants, so your applications do not have to.

Tenant lifecycle

A strict state machine with hierarchy, labels, JSON-Schema-validated settings, optimistic locking and idempotent creates. Scheduled actions and trials, soft deletion with restore, templates and custom domains.

Plans, entitlements and usage

Features and limits per plan with per-tenant overrides, plan revisions and add-ons, atomic usage counters with soft limits and threshold events, and metering exports to Stripe, Lago, Orb and OpenMeter.

Users, SSO and passkeys

Platform-wide users with memberships in many tenants, invitations, two-factor authentication, passkeys, magic links and social login. Per-tenant OIDC and SAML single sign-on and SCIM 2.0 provisioning.

OpenID Connect provider

Use Tenarium as the sign-in service of your applications: authorization code flow with PKCE, consent, discovery and JWKS with signing key rotation.

Reliable event outbox

Every change is written with its event in one PostgreSQL transaction. Each subscription has its own cursor, retries with backoff, a dead-letter queue and replay. Events are CloudEvents 1.0.

Plugins in any language

Compile plugins in with Go, run them out of process in any language, or sandbox them as WebAssembly. SDKs for Go, TypeScript and Python, plus built-in plugins for Kafka, Keycloak, Stripe, PostgreSQL, Kubernetes, S3 and more.

Authentication and authorization

API keys, OIDC, LDAP and tenant API keys; role-based access control, tenant-scoped administrators, custom tenant roles and groups, and authorizer plugins for OpenFGA, SpiceDB, OPA and Cedar.

Integrates with your stack

A Go client and the tenariumctl CLI, tenant middleware for Go, TypeScript and Python services, gateway integration for Envoy, NGINX and Traefik, and PostgreSQL row-level security helpers.

Built for operations

Embedded admin UI, OpenAPI 3.1, Prometheus metrics, OpenTelemetry tracing, horizontal scaling with leases, managed TLS certificates, KMS envelope encryption, a Helm chart, a Kubernetes operator and a Terraform provider.

Quick start

Run Tenarium with PostgreSQL and Kafka in Docker, or from source with an in-memory store.

With Docker Compose

git clone https://github.com/AimTune/tenarium.git && cd tenarium
docker compose up -d
# Admin UI: http://localhost:8080/ui/ (API key: dev-key)

From source

TENARIUM_API_KEY=dev go run ./cmd/tenarium -config config.example.yaml

curl -H "Authorization: Bearer dev" -H "Content-Type: application/json" \
-d '{"slug": "acme", "name": "Acme Inc", "plan": "free"}' \
http://localhost:8080/v1/tenants

Next: read the configuration reference or browse the API reference.