---
title: "Users & Teams in the SDK"
canonical: https://trickest.com/docs/developer-tools/sdk/users
description: "Inspect users, manage teams and invitations, and assign vault roles with @trickest/sdk."
---

# Users & Teams in the SDK

## Manage users and teams

Examples use an authenticated `client: TrickestClient`. User, team, and invite operations follow the token's organization and permissions.

| Method                                        | Description                           |
| --------------------------------------------- | ------------------------------------- |
| `listUsers(options?)`                         | Users visible to the token            |
| `getMe(options?)`                             | Current user from `/api/auth/session` |
| `listTeams(options?)`                         | Teams                                 |
| `getTeam(id, options?)`                       | Team                                  |
| `createTeam(data, options?)`                  | `{ name }`                            |
| `deleteTeam(id, options?)`                    | Delete team                           |
| `listRoles(options?)`                         | Current user's vault role information |
| `updateRole(vaultId, userId, role, options?)` | Assign role                           |
| `listInvites(options?)`                       | Pending invites                       |
| `createInvite(data, options?)`                | `CreateInvite`                        |
| `deleteInvite(id, options?)`                  | Revoke invite                         |

```ts
const me = await client.users.getMe();
console.log(me.id, me.email);

for await (const user of client.users.listUsers()) {
  console.log(user.username, user.is_active);
}
```

`updateRole()` takes a string vault ID, a numeric user ID, and a role string. Use a role accepted by the target vault; `listRoles()` reads the current user's vault role information. Team and invite mutations require the corresponding account permissions. List methods return async generators; `listRoles()` returns an array.

**Types:** `SdkUser`, `Team`, `Invite`, `CreateInvite`

<Info>
  **Concepts:** [Roles & Permissions](/docs/key-concepts/roles-and-permissions).
  **CLI:** [Users](/docs/developer-tools/cli/users).
</Info>

---
_Markdown source of https://trickest.com/docs/developer-tools/sdk/users._
