Skip to content

feat: add organization member and invitation management UI#1205

Merged
os-zhuang merged 2 commits intomainfrom
claude/design-organization-management-features
Apr 21, 2026
Merged

feat: add organization member and invitation management UI#1205
os-zhuang merged 2 commits intomainfrom
claude/design-organization-management-features

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Apr 21, 2026

Implemented complete organization management UI leveraging better-auth's organization plugin. The backend already provided full CRUD APIs via better-auth—this PR adds the Studio frontend for member and invitation management.

Changes

New React Hooks (apps/studio/src/hooks/useOrganizationMembers.ts)

  • useOrganizationMembers(orgId) - Manages member operations

    • inviteMember(email, role) - Send invitations
    • removeMember(userId) - Remove members
    • updateMemberRole(userId, newRole) - Update roles
    • Auto-reloads after mutations
  • useOrganizationInvitations(orgId) - Manages invitation lifecycle

    • Lists pending invitations with status/expiry
    • cancelInvitation(id) - Cancel pending invites
    • resendInvitation(id) - Resend invite emails

Enhanced Org Detail Page (apps/studio/src/routes/orgs.$orgId.tsx)

  • Members tab - Lists members with role badges, action menus (remove member, protected owner role)
  • Invitations tab - Shows pending invites with expiry dates, cancel action
  • Invite dialog - Email input + role selector (owner/admin/member)
  • Empty states - Helpful CTAs when no members/invitations
  • Overview card displays member count and pending invitation count

Example Usage

// Component automatically loads and manages state
const { members, inviteMember, removeMember } = useOrganizationMembers(orgId);

// Invite with role selection
await inviteMember('user@example.com', 'admin');

// Remove member with confirmation
await removeMember(userId);

Architecture

All backend logic handled by better-auth's organization plugin—no custom API code needed. Frontend consumes better-auth endpoints via existing ObjectStack client SDK methods (client.organizations.*).

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-demo Ready Ready Preview, Comment Apr 21, 2026 2:28pm
spec Ready Ready Preview, Comment Apr 21, 2026 2:28pm

Request Review

@os-zhuang os-zhuang marked this pull request as ready for review April 21, 2026 14:30
@os-zhuang os-zhuang merged commit 463fa07 into main Apr 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants