---
title: "useOrganization"
description: "useOrganization, auto-imported in the app: its options, return value and types."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/use-organization"
---
# useOrganization

## Interfaces

### Workspace

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

A workspace (Better Auth organization).

#### Extended by

- [`ActiveWorkspace`](#activeworkspace)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id">
        
      </a>
      
       <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="slug">
        
      </a>
      
       <code>
        slug
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="logo">
        
      </a>
      
       <code>
        logo?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="createdat">
        
      </a>
      
       <code>
        createdAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
      
       | <code>
        Date
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="metadata">
        
      </a>
      
       <code>
        metadata?
      </code>
    </td>
    
    <td>
      <code>
        unknown
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### WorkspaceMember

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

A workspace member row.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id-1">
        
      </a>
      
       <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organizationid">
        
      </a>
      
       <code>
        organizationId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="userid">
        
      </a>
      
       <code>
        userId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="role">
        
      </a>
      
       <code>
        role
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="user">
        
      </a>
      
       <code>
        user?
      </code>
    </td>
    
    <td>
      { <code>
        email?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        name?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; }
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        user.email?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        user.name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        user.image?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### ActiveWorkspace

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

The active workspace with its members and pending invitations.

#### Extends

- [`Workspace`](#workspace)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Inherited from
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id-2">
        
      </a>
      
       <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      .<a href="#id">
        <code>
          id
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name-1">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      .<a href="#name">
        <code>
          name
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="slug-1">
        
      </a>
      
       <code>
        slug
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      .<a href="#slug">
        <code>
          slug
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="logo-1">
        
      </a>
      
       <code>
        logo?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      .<a href="#logo">
        <code>
          logo
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="createdat-1">
        
      </a>
      
       <code>
        createdAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
      
       | <code>
        Date
      </code>
    </td>
    
    <td>
      <a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      .<a href="#createdat">
        <code>
          createdAt
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="metadata-1">
        
      </a>
      
       <code>
        metadata?
      </code>
    </td>
    
    <td>
      <code>
        unknown
      </code>
    </td>
    
    <td>
      <a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      .<a href="#metadata">
        <code>
          metadata
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="members">
        
      </a>
      
       <code>
        members
      </code>
    </td>
    
    <td>
      <a href="#workspacemember">
        <code>
          WorkspaceMember
        </code>
      </a>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="invitations">
        
      </a>
      
       <code>
        invitations
      </code>
    </td>
    
    <td>
      { <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        status
      </code>
      
      : <code>
        string
      </code>
      
      ; }<span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### ReceivedInvitation

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

An invitation the signed-in user has received.

#### Extended by

- [`InvitationDetails`](#invitationdetails)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id-3">
        
      </a>
      
       <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="email">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="role-1">
        
      </a>
      
       <code>
        role?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="status">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organizationid-1">
        
      </a>
      
       <code>
        organizationId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="inviterid">
        
      </a>
      
       <code>
        inviterId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="expiresat">
        
      </a>
      
       <code>
        expiresAt
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
       | <code>
        Date
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### InvitationDetails

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

A single invitation with its workspace/inviter context (accept-page data).

#### Extends

- [`ReceivedInvitation`](#receivedinvitation)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Inherited from
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id-4">
        
      </a>
      
       <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#id-3">
        <code>
          id
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="email-1">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#email">
        <code>
          email
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="role-2">
        
      </a>
      
       <code>
        role?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#role-1">
        <code>
          role
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="status-1">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#status">
        <code>
          status
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organizationid-2">
        
      </a>
      
       <code>
        organizationId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#organizationid-1">
        <code>
          organizationId
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="inviterid-1">
        
      </a>
      
       <code>
        inviterId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#inviterid">
        <code>
          inviterId
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="expiresat-1">
        
      </a>
      
       <code>
        expiresAt
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
       | <code>
        Date
      </code>
    </td>
    
    <td>
      <a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      .<a href="#expiresat">
        <code>
          expiresAt
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organizationname">
        
      </a>
      
       <code>
        organizationName
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organizationslug">
        
      </a>
      
       <code>
        organizationSlug
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="inviteremail">
        
      </a>
      
       <code>
        inviterEmail
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### UseOrganizationReturn

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

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="organizations">
        
      </a>
      
       <code>
        organizations
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#workspace">
        <code>
          Workspace
        </code>
      </a>
      
      <span>
        
      </span>
      
      >
    </td>
    
    <td>
      Every workspace the user belongs to.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="current">
        
      </a>
      
       <code>
        current
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#activeworkspace">
        <code>
          ActiveWorkspace
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      The active workspace (with members + invitations), <code>
        null
      </code>
      
       when none.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="member">
        
      </a>
      
       <code>
        member
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#workspacemember">
        <code>
          WorkspaceMember
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      The user's membership in the active workspace.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="role-3">
        
      </a>
      
       <code>
        role
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      The user's role <em>
        within the active workspace
      </em>
      
       (owner/admin/member or custom).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="members-1">
        
      </a>
      
       <code>
        members
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<a href="#workspacemember">
        <code>
          WorkspaceMember
        </code>
      </a>
      
      <span>
        
      </span>
      
      >
    </td>
    
    <td>
      Members of the active workspace.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="isloading">
        
      </a>
      
       <code>
        isLoading
      </code>
    </td>
    
    <td>
      <code>
        ComputedRef
      </code>
      
      <<code>
        boolean
      </code>
      
      >
    </td>
    
    <td>
      <code>
        true
      </code>
      
       while workspace state is loading.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="setactive">
        
      </a>
      
       <code>
        setActive
      </code>
    </td>
    
    <td>
      (<code>
        organizationId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Switch the active workspace. Refreshes the Convex token (the active workspace rides on JWT claims) and re-authenticates the live connection, so all workspace-scoped queries re-run against the new workspace.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="create">
        
      </a>
      
       <code>
        create
      </code>
    </td>
    
    <td>
      (<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Create a workspace (users can own several).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="invite">
        
      </a>
      
       <code>
        invite
      </code>
    </td>
    
    <td>
      (<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Invite someone to the active workspace (they receive an accept-link email).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="leave">
        
      </a>
      
       <code>
        leave
      </code>
    </td>
    
    <td>
      (<code>
        organizationId?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Leave a workspace (defaults to the active one).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="acceptinvitation">
        
      </a>
      
       <code>
        acceptInvitation
      </code>
    </td>
    
    <td>
      (<code>
        invitationId
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Accept a received invitation. Refreshes the workspace claim; with <code>
        activate: true
      </code>
      
       the joined workspace also becomes the active one.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="declineinvitation">
        
      </a>
      
       <code>
        declineInvitation
      </code>
    </td>
    
    <td>
      (<code>
        invitationId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Decline a received invitation.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cancelinvitation">
        
      </a>
      
       <code>
        cancelInvitation
      </code>
    </td>
    
    <td>
      (<code>
        invitationId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Cancel a pending invitation you (or a teammate) sent — inviter side.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="getinvitation">
        
      </a>
      
       <code>
        getInvitation
      </code>
    </td>
    
    <td>
      (<code>
        invitationId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<a href="#invitationdetails">
        <code>
          InvitationDetails
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      A single invitation with workspace/inviter context (for the accept page).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="listreceivedinvitations">
        
      </a>
      
       <code>
        listReceivedInvitations
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<a href="#receivedinvitation">
        <code>
          ReceivedInvitation
        </code>
      </a>
      
      <span>
        
      </span>
      
      >
    </td>
    
    <td>
      Invitations the signed-in user has received (across workspaces).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/runtime/vue/composables/use-organization.ts" rel="nofollow">
        src/runtime/vue/composables/use-organization.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Functions

### useOrganization()

```ts
function useOrganization(): UseOrganizationReturn;
```

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

Workspace (organization) state and actions, including the full invitation
flow (invite / accept / decline / cancel — the packaged `AcceptInvitation`
component and `/accept-invitation` page build on these). Anything beyond —
member removal, role updates — lives on the fully-typed client:
`useAuth().client.organization.*`.

Every action rejects when the server refuses it (the client itself resolves
a refusal as `{ error }`), so a `catch` sees each failure; a rate-limited
call rejects with the wait in `retryAfter`. Each still resolves the client's
result on success.

#### Returns

[`UseOrganizationReturn`](#useorganizationreturn)

#### Example

```vue
<script setup lang="ts">
const { organizations, current, setActive, create } = useOrganization()
</script>
<template>
  <select :value="current?.id" @change="setActive(($event.target as HTMLSelectElement).value)">
    <option v-for="workspace in organizations" :key="workspace.id" :value="workspace.id">
      {{ workspace.name }}
    </option>
  </select>
</template>
```


## Sitemap

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