Accountmaker Docs
Types

Membership

Association between a user and an account with a specific role for access control.

membership roles access-control permissions

Membership

A Membership links a user to an account with a specific role. Users can have memberships in multiple accounts, each with different roles.

Schema

interface Membership {
  id: string; // "mbr..." - Unique identifier
  user_id: string; // User who has membership
  account_id: string; // Account membership is in
  role: MembershipRole;
}

type MembershipRole = "owner" | "member" | "viewer";

Properties

PropertyTypeDescription
idstringKSUID with mbr prefix
user_idstringUser reference
account_idstringAccount reference
roleenumPermission level

Roles

RolePermissions
ownerFull access, manage members, delete account
memberRead/write resources
viewerRead-only access

Multi-Account Access

User (uid_123)
├── Membership → Account A (role: owner)
├── Membership → Account B (role: member)
└── Membership → Account C (role: viewer)

Token Claims

When accessing an account, the token includes:

{
  "uid": "uid_123",
  "acc": "acc_A",
  "role": "owner"
}

Example

{
  "id": "mbr_2kHfPZcN9xW4mE8RtY7vB",
  "user_id": "uid_1jGePYbM8wV3lD7QsX6uA",
  "account_id": "acc_3lIfQZdO0yX5nF9SuY8wC",
  "role": "member"
}