← All modules
platform

Tenants

Live

Tenant and project administration for multi-tenant Cuitty installs, gated by admin RBAC.

event.type === "tenant" modules/tenants
Overview

What Tenants does

Tenants provides the project administration layer for multi-tenant Cuitty installs: project configuration, ingest limits, feature entitlements, and owner metadata.

The module reads from auth-owned identity tables where needed, but keeps Cuitty-specific tenant configuration in its own schema so self-hosted installs can reason about limits and defaults without coupling to one auth implementation.

Wire payload

Same shape, three syntaxes

The wire protocol is plain HTTP, plain JSON, HMAC-SHA256. The TypeScript tab uses the SDK; the cURL tab is the raw HTTP equivalent; the Python tab shows the preview SDK shape.

import { createCuittyClient } from "@cuitty/sdk";
import { tenantsPlugin } from "@cuitty/sdk/plugins/tenants";

const cuitty = createCuittyClient({
  portalUrl: "https://app.cuitty.com",
  projectId: process.env.CUITTY_PROJECT_ID!,
  apiKey: process.env.CUITTY_API_KEY!,
});
cuitty.use(tenantsPlugin());
cuitty.start();

await cuitty.emit({
  type: "tenant",
  timestamp: new Date().toISOString(),
  data: {
    projectId: "proj_01",
    action: "config.updated",
    ingestRpsLimit: 250,
  },
});
Storage

Database schema

Excerpt from modules/tenants/schema.sql. One libSQL file per module — back it up with cp.

CREATE TABLE cuitty_tenants.project_config (
  project_id TEXT PRIMARY KEY,
  ingest_rps_limit INTEGER NOT NULL DEFAULT 100,
  retention_days INTEGER NOT NULL DEFAULT 30,
  enabled_modules JSONB NOT NULL DEFAULT '[]',
  updated_at BIGINT NOT NULL
);

Related modules