Tenant Setup
GTM Clarity is a multi-tenant platform where each tenant maps to a Clerk organization. Every piece of data -- accounts, people, scores, connectors -- is scoped to a single tenant to guarantee complete data isolation.
How Tenants Work
A tenant is the root isolation boundary. When a Clerk organization is created and linked, GTM Clarity provisions a corresponding row in the tenants table:
| Column | Type | Description |
|---|---|---|
id | text (UUID) | Internal primary key |
clerk_org_id | text | Clerk organization ID (unique index) |
name | text | Display name |
slug | text | URL-safe identifier |
settings | jsonb | Tenant-level configuration overrides |
created_at | timestamptz | Creation timestamp |
updated_at | timestamptz | Last modification timestamp |
Every table in the database includes a tenant_id column. Every query filters by tenant_id -- there is no mechanism for cross-tenant data access. This is enforced by convention through the tenantColumns base helper used in all schema definitions.
Creating a Tenant
Step 1: Create a Clerk Organization
Tenants are created through the Clerk dashboard or via the Clerk API. Each Clerk organization becomes one GTM Clarity tenant.
- Navigate to the Clerk Dashboard
- Go to Organizations and click Create Organization
- Enter the organization name and slug
- Save -- the
clerk_org_idis generated automatically
Step 2: Automatic Provisioning
When a user first signs into GTM Clarity under the new organization, the platform automatically:
- Detects the
clerk_org_idfrom the session - Creates a
tenantsrow if one does not already exist - Associates the user with the tenant
No manual database intervention is required.
Step 3: Initial Configuration
After tenant creation, an admin should complete the following checklist:
| Task | Where | Required |
|---|---|---|
| Set up scoring configuration | Settings > Scoring | Yes |
| Connect at least one data source | Settings > Connectors | Yes |
| Configure ICP profile | Settings > Scoring > Fit | Yes |
| Set engagement decay parameters | Settings > Scoring > Engagement | Recommended |
| Invite team members | Settings > Team | Recommended |
| Configure field mappings | Settings > Connectors > Mappings | Optional |
| Set up buying group role templates | Settings > Buying Groups | Optional |
Inviting Users
Users are invited through the Clerk organization management interface:
- Go to Settings > Team in the GTM Clarity dashboard
- Click Invite Member
- Enter the email address and select a role (
admin,manager, orviewer) - The user receives an email invitation
New users automatically inherit the tenant context from their Clerk organization membership. No additional tenant configuration is needed per user.
Tenant Settings
The settings JSONB column on the tenants table stores tenant-level overrides. These are merged with system defaults at runtime:
{
"timezone": "America/New_York",
"defaultScoringVersion": 1,
"features": {
"buyingGroups": true,
"writeback": false
}
}
Multi-Tenant Data Flow
Never bypass the tenant filter in queries. All database access must include a WHERE tenant_id = ? clause. The base schema helpers (tenantColumns) exist specifically to enforce this pattern.
Related Pages
- RBAC & Roles -- Role assignments within a tenant
- Scoring Configuration -- Per-tenant scoring setup
- Environment Setup -- Infrastructure prerequisites
- Database Schema -- Full schema reference