Managing Members
Invite members, assign roles, and track seat usage.
Use the built-in members screen to manage workspace membership. One call handles invites, roles, seat tracking, and permissions automatically.
import { useSaaSAuth } from '@buildbase/sdk/react';
function TeamButton() {
const { openWorkspaceSettings } = useSaaSAuth();
return (
<button onClick={() => openWorkspaceSettings('users')}>Manage Team</button>
);
}The members screen includes:
- Invite members by email with role selection - the address need not have an account yet, see Invitations
- Pending invitations under the form, with resend and revoke
- View all members with their roles
- Change member roles
- Remove members
- Seat usage bar (when seat pricing is enabled)
- Permission-gated - only users with the right permissions see management controls
Note
With @buildbase/sdk
0.0.71
or later on a server from
release 22
, the members screen's invite form sends an invitation to any
address, account or not, and lists it as pending until it is answered. Before
that it added an existing account at once. addUser is unchanged.
Checking seat availability
Use useSeatStatus() to show seat info in your UI:
import { useSeatStatus } from '@buildbase/sdk/react';
function SeatBadge({ workspace }) {
const { memberCount, includedSeats, canInvite } = useSeatStatus(workspace);
return (
<p>
{memberCount} of {includedSeats} seats used
{!canInvite && ' — seat limit reached'}
</p>
);
}| Return | Type | Description |
|---|---|---|
memberCount | number | Current members. Pending invitations also hold seats; the members screen counts them |
includedSeats | number | Seats in the plan |
availableSeats | number | Remaining seats (Infinity if unlimited) |
canInvite | boolean | Whether invites are allowed |
inviteBlockReason | 'seat_limit_reached' | 'settings_user_limit_reached' | 'no_subscription' | null | Machine-readable code for why invites are blocked, or null if allowed |
inviteBlockMessageKey | string | null | i18n key for the human-readable block message - resolve with t(key, inviteBlockMessageValues) |
Programmatic access
If you need to manage members from code (e.g., onboarding flows), use useSaaSWorkspaces():
import { useSaaSWorkspaces } from '@buildbase/sdk/react';
const { addUser, inviteMember, removeUser, updateUser } = useSaaSWorkspaces();
// Invite during onboarding: the address need not have an account yet
await inviteMember(workspaceId, '[email protected]', 'editor');
// Add an account that already exists, at once (404 when it does not)
await addUser(workspaceId, '[email protected]', 'editor');Required permissions
| Action | Permission |
|---|---|
| Invite a member | WORKSPACE_MEMBERS_INVITE |
| Remove a member | WORKSPACE_MEMBERS_REMOVE |
| Change a role | WORKSPACE_MEMBERS_ROLE_CHANGE |
Next Steps
- Invitations - Reach people who have no account yet.
- Settings Screens - All pre-built screens.