Skip to main content
Organizations (also called teams) allow groups to collaboratively create and manage bounties. Each user has a personal organization by default, and can create or join additional team organizations.

Organization Types

There are two types of organizations on the platform:

Personal Organizations

  • Automatically created for each user
  • Cannot be deleted
  • Single-member team
  • Used for individual bounty creation
  • Has unique slug based on username

Team Organizations

  • Created by users for collaboration
  • Support multiple members
  • Shared bounty management
  • Can be deleted by owner (if no members remain)
  • Custom name and slug

Creating an Organization

Organizations are managed through the Better Auth organization plugin. Create a new team organization:
// Via Better Auth client
const org = await authClient.organization.create({
  name: "Acme Engineering",
  slug: "acme-eng"
});

Organization Fields

  • Name: Display name for the organization
  • Slug: URL-friendly identifier (lowercase, alphanumeric, hyphens)
  • Logo: Optional organization logo URL
  • Stripe Customer ID: Automatically created for billing

Organization Slugs

Slugs are unique identifiers used in URLs and must follow specific rules:

Slug Requirements

  • 2-32 characters long
  • Lowercase letters, numbers, and hyphens only
  • Cannot start or end with hyphen
  • No consecutive hyphens
  • Must be unique across all organizations
  • Cannot use reserved slugs (e.g., admin, api, settings)

Updating Slugs

Only organization owners can update slugs:
const result = await trpc.organization.updateSlug.mutate({
  slug: "new-slug-name"
});
Changing your organization slug will break existing links and bookmarks. Update external references after changing slugs.

Member Roles

Organizations have a simple two-role permission model:

Owner Role

Permissions:
  • Full administrative access
  • Invite and remove members
  • Update organization settings
  • Delete organization
  • Create and manage all bounties
  • Update organization slug
  • Manage billing and payments

Member Role

Permissions:
  • View organization details
  • Create bounties for the organization
  • Manage bounties they created
  • View all organization bounties
  • Comment on bounties
All bounties are organization-scoped. When you create a bounty, it belongs to your active organization.

Managing Members

Viewing Members

Get all members of your active organization:
const { members } = await trpc.organization.getMembers.query();

// Each member includes:
// - User information (name, image, handle)
// - Role (owner or member)
// - Join date

Inviting Members

Invite users to join your organization via email:
// Via Better Auth client
const invitation = await authClient.organization.inviteMember({
  email: "[email protected]",
  role: "member"
});

Invitation Lifecycle

Invitations have expiration dates and multiple statuses:
  • pending: Sent, awaiting response
  • accepted: User joined the organization
  • rejected: User declined invitation
  • canceled: Sender cancelled invitation
  • expired: Invitation expired without response

Removing Members

Only owners can remove members from the organization. This is managed through the Better Auth organization plugin.

Organization Switching

Users can be members of multiple organizations and switch between them:
// List all organizations you're a member of
const { orgs } = await trpc.organization.listMyOrgs.query();

// Switch active organization via Better Auth
await authClient.organization.setActive({
  organizationId: "org-uuid"
});

Active Organization

Your active organization determines:
  • Which organization’s bounties you see
  • Which organization is billed when creating bounties
  • Which organization’s members you can view
  • Which organization’s settings you can modify
The active organization is stored in session state and persists across browser sessions.

Organization Billing

Each organization has its own Stripe customer for billing.

Automatic Customer Creation

When an organization creates its first bounty:
  1. Platform creates Stripe customer
  2. Customer ID stored in organization record
  3. All future bounty payments use this customer
  4. Billing information managed through Stripe

Monthly Spending

Track organization spending:
const spending = await trpc.bounties.getMonthlySpend.query();

// Returns:
// - monthlySpend: Total spent this calendar month
// - bountyCount: Number of bounties funded this month
// - allTimeSpend: Total ever spent
// - allTimeBountyCount: Total bounties ever funded
// - periodStart/periodEnd: Current billing period
Spending is calculated based on bounty amounts funded (not including platform fees) and resets monthly.

Deleting Organizations

Owners can delete team organizations under certain conditions:

Deletion Requirements

  1. Must not be a personal organization
  2. Must remove all other members first (only owner remains)
  3. All associated bounties will be cascaded and deleted
const result = await trpc.organization.deleteOrg.mutate();
Deleting an organization is permanent and will delete all associated bounties, comments, and data. This action cannot be undone.

Organization Details

View comprehensive organization information:
const { org, role, memberCount } = await trpc.organization.getActiveOrg.query();

// org includes:
// - id, name, slug
// - logo URL
// - isPersonal flag
// - creation date
//
// role: Your role in the organization
// memberCount: Total number of members

Best Practices

Use descriptive organization names that clearly identify your team. Avoid generic names that might conflict with other organizations.
Create your team organization before inviting members. This ensures bounties are properly scoped from the start.
Grant owner role sparingly. Most team members should have member role, which provides sufficient permissions for creating and managing bounties.
Choose organization slugs that are short, memorable, and related to your team name. They appear in URLs and are harder to change later.
Regularly review monthly spending to manage your budget and ensure appropriate bounty amounts.

Common Workflows

Creating a Team

1

Create Organization

Create a new team organization with a unique name and slug.
2

Invite Members

Send email invitations to team members with appropriate roles.
3

Set as Active

Switch to the new organization as your active org.
4

Create Bounties

Start creating bounties that will be scoped to your team.

Joining a Team

1

Receive Invitation

Get invitation email with organization details.
2

Accept Invitation

Click accept link or accept through the platform.
3

Switch Organization

Change your active organization to the new team.
4

Start Contributing

Begin creating and managing bounties for the team.

Build docs developers (and LLMs) love