---
title: "Manage members"
description: "List a workspace's members, change their built-in role and remove them from your own team page: who may do what, what a removal does at once, and the owner a workspace always keeps."
canonical_url: "https://nuxt-backend.dev/docs/build/auth/workspaces/members"
---
# Manage members

> List a workspace's members, change their built-in role and remove them from your own team page: who may do what, what a removal does at once, and the owner a workspace always keeps.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

- [Source](https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-workspace.ts)

A workspace's owner and admins decide who belongs to it and in which role. `useWorkspace()` lists the active workspace's members and changes them, so a team page of your own takes a few lines. People join by [invitation](https://nuxt-backend.dev/docs/build/auth/workspaces/invitations), and leave when they choose or when an owner or admin removes them.

Better Auth's organization plugin keeps the members and checks who may change them. The package adds the actions on `useWorkspace()`, the recent sign-in they take, and a removal that locks the person out on their next call.

## Build a team page

```vue [app/pages/team.vue]
<script setup lang="ts">
definePageMeta({ auth: true })

const { members, role, updateMemberRole, removeMember, error } = useWorkspace()
const { withReauthentication } = useReauthentication()
const manages = computed(() => role.value === 'owner' || role.value === 'admin')
</script>

<template>
  <ul>
    <li v-for="member in members" :key="member.id">
      {{ member.user.name }} · {{ member.role }}
      <template v-if="manages && member.role !== 'owner'">
        <button type="button" @click="withReauthentication(() => updateMemberRole(member.id, 'admin'))">Make {{ member.user.name }} an admin</button>
        <button type="button" @click="withReauthentication(() => removeMember(member.id))">Remove {{ member.user.name }}</button>
      </template>
    </li>
  </ul>
  <p v-if="error" role="alert">{{ error.message }}</p>
</template>
```

Each member carries `id`, `role`, `createdAt` and `user` (`id`, `name`, `email`, `image`).

<table>
<thead>
  <tr>
    <th>
      Action of <code>
        useWorkspace()
      </code>
    </th>
    
    <th>
      Who
    </th>
    
    <th>
      Does
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        members
      </code>
    </td>
    
    <td>
      every member
    </td>
    
    <td>
      The active workspace's members, live.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updateMemberRole(memberId, role)
      </code>
    </td>
    
    <td>
      owner, admin
    </td>
    
    <td>
      Gives a member another built-in role: <code>
        owner
      </code>
      
      , <code>
        admin
      </code>
      
       or <code>
        member
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        removeMember(memberId)
      </code>
    </td>
    
    <td>
      owner, admin
    </td>
    
    <td>
      Takes a member out of the workspace.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        leave(workspaceId?)
      </code>
    </td>
    
    <td>
      every member
    </td>
    
    <td>
      Leaves a workspace, the active one by default.
    </td>
  </tr>
</tbody>
</table>

## What each change does

- **Changing a role and removing a member take a recent sign-in.** Wrap the call in `withReauthentication`, as above.
- **A removal is immediate.** The `workspace` tier reads membership fresh on every call, so a removed member's next call is refused, and their active workspace is cleared.
- **A workspace always keeps an owner.** Better Auth refuses a change that would leave it without one, so the last owner can neither leave nor lose the role.
- **An administrator's visit** can read the members and change nothing.
- **Every change is recorded** on the [activity trail](https://nuxt-backend.dev/docs/build/auth/admin/audit-log) the workspace's owners and admins read on `/settings`.

A role is never a seat: members are free, and nothing counts them for billing. The owner and admins manage the workspace's plan and credits ([Give people roles](https://nuxt-backend.dev/docs/build/auth/access/roles#workspace-roles)).

## What waits for a later release

Roles an owner defines, moving ownership to another member, billing as a permission inside roles, and shareable links into a workspace are features of service apps. They arrive in a later release ([Roadmap](https://nuxt-backend.dev/docs/start/roadmap#service-app-features)).

## Related

- [Invite people to a workspace](https://nuxt-backend.dev/docs/build/auth/workspaces/invitations): how members join.
- [Give people roles](https://nuxt-backend.dev/docs/build/auth/access/roles): workspace roles beside app-wide ones.
- [Protect backend functions](https://nuxt-backend.dev/docs/build/auth/access/functions): the `workspace` tier, and `ctx.workspace.role`.
- [Record and review activity](https://nuxt-backend.dev/docs/build/auth/admin/audit-log): the trail every change lands on.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
