ObjectStackObjectStack

Organization

Organization protocol schemas

Organization Schema (Multi-Tenant Architecture)

Defines the standard organization/workspace model for ObjectStack.

Supports B2B SaaS scenarios where users belong to multiple teams/workspaces.

This aligns with better-auth's organization plugin capabilities.

Source: packages/spec/src/identity/organization.zod.ts

TypeScript Usage

import { Invitation, InvitationStatus, Member, Organization } from '@objectstack/spec/identity';
import type { Invitation, InvitationStatus, Member, Organization } from '@objectstack/spec/identity';

// Validate data
const result = Invitation.parse(data);

Invitation

Properties

PropertyTypeRequiredDescription
idstringUnique invitation identifier
organizationIdstringOrganization ID
emailstringInvitee email address
rolestringRole to assign upon acceptance
statusEnum<'pending' | 'accepted' | 'rejected' | 'expired'>Invitation status
expiresAtstringInvitation expiry timestamp
inviterIdstringUser ID of the inviter
createdAtstringInvitation creation timestamp
updatedAtstringLast update timestamp

InvitationStatus

Allowed Values

  • pending
  • accepted
  • rejected
  • expired

Member

Properties

PropertyTypeRequiredDescription
idstringUnique member identifier
organizationIdstringOrganization ID
userIdstringUser ID
rolestringMember role (e.g., owner, admin, member, guest)
createdAtstringMember creation timestamp
updatedAtstringLast update timestamp

Organization

Properties

PropertyTypeRequiredDescription
idstringUnique organization identifier
namestringOrganization display name
slugstringUnique URL-friendly slug (lowercase alphanumeric, hyphens, underscores)
logostringoptionalOrganization logo URL
metadataRecord<string, any>optionalCustom metadata
createdAtstringOrganization creation timestamp
updatedAtstringLast update timestamp

On this page