---
title: "nuxt-backend/auth"
description: "Every export of nuxt-backend/auth, with its signature and where it is defined."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/auth"
---
# nuxt-backend/auth

## Classes

### APIError

Defined in: node_modules/@better-auth/core/dist/error/index.d.mts:11

The auth layer's request error, re-exported so an app needs no direct
dependency on the auth library. Throw it from a hook `setupAuth` passes
through (`authOptions.databaseHooks`, `organization.organizationHooks`) to
refuse with a status and a message the client shows, not a bare 500:
`throw new APIError('BAD_REQUEST', { message: 'Invite a company address.' })`.
Add a catalog `code` and its fields to the body
(`{ code: 'invalid_input', field: 'email', message }`) and the client
reads it with `getBackendError` like the package's own refusals.

#### Extends

- `APIError`

#### Constructors

##### Constructor

```ts
new APIError(...args): APIError;
```

Defined in: node_modules/@better-auth/core/dist/error/index.d.mts:18

###### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      ...<code>
        args
      </code>
    </td>
    
    <td>
      [<code>
        status?
      </code>
      
      : | <code>
        Status
      </code>
      
       | <code>
        "OK"
      </code>
      
       | <code>
        "CREATED"
      </code>
      
       | <code>
        "ACCEPTED"
      </code>
      
       | <code>
        "NO_CONTENT"
      </code>
      
       | <code>
        "MULTIPLE_CHOICES"
      </code>
      
       | <code>
        "MOVED_PERMANENTLY"
      </code>
      
       | <code>
        "FOUND"
      </code>
      
       | <code>
        "SEE_OTHER"
      </code>
      
       | <code>
        "NOT_MODIFIED"
      </code>
      
       | <code>
        "TEMPORARY_REDIRECT"
      </code>
      
       | <code>
        "BAD_REQUEST"
      </code>
      
       | <code>
        "UNAUTHORIZED"
      </code>
      
       | <code>
        "PAYMENT_REQUIRED"
      </code>
      
       | <code>
        "FORBIDDEN"
      </code>
      
       | <code>
        "NOT_FOUND"
      </code>
      
       | <code>
        "METHOD_NOT_ALLOWED"
      </code>
      
       | <code>
        "NOT_ACCEPTABLE"
      </code>
      
       | <code>
        "PROXY_AUTHENTICATION_REQUIRED"
      </code>
      
       | <code>
        "REQUEST_TIMEOUT"
      </code>
      
       | <code>
        "CONFLICT"
      </code>
      
       | <code>
        "GONE"
      </code>
      
       | <code>
        "LENGTH_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_FAILED"
      </code>
      
       | <code>
        "PAYLOAD_TOO_LARGE"
      </code>
      
       | <code>
        "URI_TOO_LONG"
      </code>
      
       | <code>
        "UNSUPPORTED_MEDIA_TYPE"
      </code>
      
       | <code>
        "RANGE_NOT_SATISFIABLE"
      </code>
      
       | <code>
        "EXPECTATION_FAILED"
      </code>
      
       | <code>
        "I'M_A_TEAPOT"
      </code>
      
       | <code>
        "MISDIRECTED_REQUEST"
      </code>
      
       | <code>
        "UNPROCESSABLE_ENTITY"
      </code>
      
       | <code>
        "LOCKED"
      </code>
      
       | <code>
        "FAILED_DEPENDENCY"
      </code>
      
       | <code>
        "TOO_EARLY"
      </code>
      
       | <code>
        "UPGRADE_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_REQUIRED"
      </code>
      
       | <code>
        "TOO_MANY_REQUESTS"
      </code>
      
       | <code>
        "REQUEST_HEADER_FIELDS_TOO_LARGE"
      </code>
      
       | <code>
        "UNAVAILABLE_FOR_LEGAL_REASONS"
      </code>
      
       | <code>
        "INTERNAL_SERVER_ERROR"
      </code>
      
       | <code>
        "NOT_IMPLEMENTED"
      </code>
      
       | <code>
        "BAD_GATEWAY"
      </code>
      
       | <code>
        "SERVICE_UNAVAILABLE"
      </code>
      
       | <code>
        "GATEWAY_TIMEOUT"
      </code>
      
       | <code>
        "HTTP_VERSION_NOT_SUPPORTED"
      </code>
      
       | <code>
        "VARIANT_ALSO_NEGOTIATES"
      </code>
      
       | <code>
        "INSUFFICIENT_STORAGE"
      </code>
      
       | <code>
        "LOOP_DETECTED"
      </code>
      
       | <code>
        "NOT_EXTENDED"
      </code>
      
       | <code>
        "NETWORK_AUTHENTICATION_REQUIRED"
      </code>
      
      , <code>
        body?
      </code>
      
      : { <code>
        message?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        code?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        cause?
      </code>
      
      : <code>
        unknown
      </code>
      
      ; } & <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        any
      </code>
      
      >, <code>
        headers?
      </code>
      
      : <code>
        HeadersInit
      </code>
      
      , <code>
        statusCode?
      </code>
      
      : <code>
        number
      </code>
      
      ]
    </td>
  </tr>
</tbody>
</table>

###### Returns

[`APIError`](#apierror)

###### Overrides

```ts
APIError$1.constructor
```

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="status">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      | <code>
        Status
      </code>
      
       | <code>
        "OK"
      </code>
      
       | <code>
        "CREATED"
      </code>
      
       | <code>
        "ACCEPTED"
      </code>
      
       | <code>
        "NO_CONTENT"
      </code>
      
       | <code>
        "MULTIPLE_CHOICES"
      </code>
      
       | <code>
        "MOVED_PERMANENTLY"
      </code>
      
       | <code>
        "FOUND"
      </code>
      
       | <code>
        "SEE_OTHER"
      </code>
      
       | <code>
        "NOT_MODIFIED"
      </code>
      
       | <code>
        "TEMPORARY_REDIRECT"
      </code>
      
       | <code>
        "BAD_REQUEST"
      </code>
      
       | <code>
        "UNAUTHORIZED"
      </code>
      
       | <code>
        "PAYMENT_REQUIRED"
      </code>
      
       | <code>
        "FORBIDDEN"
      </code>
      
       | <code>
        "NOT_FOUND"
      </code>
      
       | <code>
        "METHOD_NOT_ALLOWED"
      </code>
      
       | <code>
        "NOT_ACCEPTABLE"
      </code>
      
       | <code>
        "PROXY_AUTHENTICATION_REQUIRED"
      </code>
      
       | <code>
        "REQUEST_TIMEOUT"
      </code>
      
       | <code>
        "CONFLICT"
      </code>
      
       | <code>
        "GONE"
      </code>
      
       | <code>
        "LENGTH_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_FAILED"
      </code>
      
       | <code>
        "PAYLOAD_TOO_LARGE"
      </code>
      
       | <code>
        "URI_TOO_LONG"
      </code>
      
       | <code>
        "UNSUPPORTED_MEDIA_TYPE"
      </code>
      
       | <code>
        "RANGE_NOT_SATISFIABLE"
      </code>
      
       | <code>
        "EXPECTATION_FAILED"
      </code>
      
       | <code>
        "I'M_A_TEAPOT"
      </code>
      
       | <code>
        "MISDIRECTED_REQUEST"
      </code>
      
       | <code>
        "UNPROCESSABLE_ENTITY"
      </code>
      
       | <code>
        "LOCKED"
      </code>
      
       | <code>
        "FAILED_DEPENDENCY"
      </code>
      
       | <code>
        "TOO_EARLY"
      </code>
      
       | <code>
        "UPGRADE_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_REQUIRED"
      </code>
      
       | <code>
        "TOO_MANY_REQUESTS"
      </code>
      
       | <code>
        "REQUEST_HEADER_FIELDS_TOO_LARGE"
      </code>
      
       | <code>
        "UNAVAILABLE_FOR_LEGAL_REASONS"
      </code>
      
       | <code>
        "INTERNAL_SERVER_ERROR"
      </code>
      
       | <code>
        "NOT_IMPLEMENTED"
      </code>
      
       | <code>
        "BAD_GATEWAY"
      </code>
      
       | <code>
        "SERVICE_UNAVAILABLE"
      </code>
      
       | <code>
        "GATEWAY_TIMEOUT"
      </code>
      
       | <code>
        "HTTP_VERSION_NOT_SUPPORTED"
      </code>
      
       | <code>
        "VARIANT_ALSO_NEGOTIATES"
      </code>
      
       | <code>
        "INSUFFICIENT_STORAGE"
      </code>
      
       | <code>
        "LOOP_DETECTED"
      </code>
      
       | <code>
        "NOT_EXTENDED"
      </code>
      
       | <code>
        "NETWORK_AUTHENTICATION_REQUIRED"
      </code>
    </td>
    
    <td>
      <code>
        APIError$1.status
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@better-auth/core/dist/error/index.d.mts:12
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="body">
        
      </a>
      
       <code>
        body
      </code>
    </td>
    
    <td>
      | { <code>
        message?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        code?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        cause?
      </code>
      
      : <code>
        unknown
      </code>
      
      ; } & <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        any
      </code>
      
      > | <code>
        undefined
      </code>
    </td>
    
    <td>
      <code>
        APIError$1.body
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@better-auth/core/dist/error/index.d.mts:13
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="headers">
        
      </a>
      
       <code>
        headers
      </code>
    </td>
    
    <td>
      <code>
        HeadersInit
      </code>
    </td>
    
    <td>
      <code>
        APIError$1.headers
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@better-auth/core/dist/error/index.d.mts:14
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="statuscode">
        
      </a>
      
       <code>
        statusCode
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        APIError$1.statusCode
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@better-auth/core/dist/error/index.d.mts:15
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="message">
        
      </a>
      
       <code>
        message
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        APIError$1.message
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@better-auth/core/dist/error/index.d.mts:16
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="errorstack">
        
      </a>
      
       <code>
        errorStack
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        undefined
      </code>
    </td>
    
    <td>
      <code>
        APIError$1.errorStack
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@better-auth/core/dist/error/index.d.mts:17
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cause">
        
      </a>
      
       <code>
        cause?
      </code>
    </td>
    
    <td>
      <code>
        unknown
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <code>
        APIError$1.cause
      </code>
    </td>
    
    <td>
      node_modules/typescript/lib/lib.es2022.error.d.ts:24
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <code>
        APIError$1.name
      </code>
    </td>
    
    <td>
      node_modules/typescript/lib/lib.es5.d.ts:1074
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="stack">
        
      </a>
      
       <code>
        stack?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <code>
        APIError$1.stack
      </code>
    </td>
    
    <td>
      node_modules/typescript/lib/lib.es5.d.ts:1076
    </td>
  </tr>
</tbody>
</table>

#### Methods

##### fromStatus()

```ts
static fromStatus(status, body?): APIError;
```

Defined in: node_modules/@better-auth/core/dist/error/index.d.mts:19

###### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      | <code>
        Status
      </code>
      
       | <code>
        "OK"
      </code>
      
       | <code>
        "CREATED"
      </code>
      
       | <code>
        "ACCEPTED"
      </code>
      
       | <code>
        "NO_CONTENT"
      </code>
      
       | <code>
        "MULTIPLE_CHOICES"
      </code>
      
       | <code>
        "MOVED_PERMANENTLY"
      </code>
      
       | <code>
        "FOUND"
      </code>
      
       | <code>
        "SEE_OTHER"
      </code>
      
       | <code>
        "NOT_MODIFIED"
      </code>
      
       | <code>
        "TEMPORARY_REDIRECT"
      </code>
      
       | <code>
        "BAD_REQUEST"
      </code>
      
       | <code>
        "UNAUTHORIZED"
      </code>
      
       | <code>
        "PAYMENT_REQUIRED"
      </code>
      
       | <code>
        "FORBIDDEN"
      </code>
      
       | <code>
        "NOT_FOUND"
      </code>
      
       | <code>
        "METHOD_NOT_ALLOWED"
      </code>
      
       | <code>
        "NOT_ACCEPTABLE"
      </code>
      
       | <code>
        "PROXY_AUTHENTICATION_REQUIRED"
      </code>
      
       | <code>
        "REQUEST_TIMEOUT"
      </code>
      
       | <code>
        "CONFLICT"
      </code>
      
       | <code>
        "GONE"
      </code>
      
       | <code>
        "LENGTH_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_FAILED"
      </code>
      
       | <code>
        "PAYLOAD_TOO_LARGE"
      </code>
      
       | <code>
        "URI_TOO_LONG"
      </code>
      
       | <code>
        "UNSUPPORTED_MEDIA_TYPE"
      </code>
      
       | <code>
        "RANGE_NOT_SATISFIABLE"
      </code>
      
       | <code>
        "EXPECTATION_FAILED"
      </code>
      
       | <code>
        "I'M_A_TEAPOT"
      </code>
      
       | <code>
        "MISDIRECTED_REQUEST"
      </code>
      
       | <code>
        "UNPROCESSABLE_ENTITY"
      </code>
      
       | <code>
        "LOCKED"
      </code>
      
       | <code>
        "FAILED_DEPENDENCY"
      </code>
      
       | <code>
        "TOO_EARLY"
      </code>
      
       | <code>
        "UPGRADE_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_REQUIRED"
      </code>
      
       | <code>
        "TOO_MANY_REQUESTS"
      </code>
      
       | <code>
        "REQUEST_HEADER_FIELDS_TOO_LARGE"
      </code>
      
       | <code>
        "UNAVAILABLE_FOR_LEGAL_REASONS"
      </code>
      
       | <code>
        "INTERNAL_SERVER_ERROR"
      </code>
      
       | <code>
        "NOT_IMPLEMENTED"
      </code>
      
       | <code>
        "BAD_GATEWAY"
      </code>
      
       | <code>
        "SERVICE_UNAVAILABLE"
      </code>
      
       | <code>
        "GATEWAY_TIMEOUT"
      </code>
      
       | <code>
        "HTTP_VERSION_NOT_SUPPORTED"
      </code>
      
       | <code>
        "VARIANT_ALSO_NEGOTIATES"
      </code>
      
       | <code>
        "INSUFFICIENT_STORAGE"
      </code>
      
       | <code>
        "LOOP_DETECTED"
      </code>
      
       | <code>
        "NOT_EXTENDED"
      </code>
      
       | <code>
        "NETWORK_AUTHENTICATION_REQUIRED"
      </code>
      
       | <code>
        undefined
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        body?
      </code>
    </td>
    
    <td>
      { <code>
        message?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        code?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        cause?
      </code>
      
      : <code>
        unknown
      </code>
      
      ; } & <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        any
      </code>
      
      >
    </td>
  </tr>
</tbody>
</table>

###### Returns

[`APIError`](#apierror)

##### from()

```ts
static from(status, error): APIError;
```

Defined in: node_modules/@better-auth/core/dist/error/index.d.mts:20

###### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      | <code>
        Status
      </code>
      
       | <code>
        "OK"
      </code>
      
       | <code>
        "CREATED"
      </code>
      
       | <code>
        "ACCEPTED"
      </code>
      
       | <code>
        "NO_CONTENT"
      </code>
      
       | <code>
        "MULTIPLE_CHOICES"
      </code>
      
       | <code>
        "MOVED_PERMANENTLY"
      </code>
      
       | <code>
        "FOUND"
      </code>
      
       | <code>
        "SEE_OTHER"
      </code>
      
       | <code>
        "NOT_MODIFIED"
      </code>
      
       | <code>
        "TEMPORARY_REDIRECT"
      </code>
      
       | <code>
        "BAD_REQUEST"
      </code>
      
       | <code>
        "UNAUTHORIZED"
      </code>
      
       | <code>
        "PAYMENT_REQUIRED"
      </code>
      
       | <code>
        "FORBIDDEN"
      </code>
      
       | <code>
        "NOT_FOUND"
      </code>
      
       | <code>
        "METHOD_NOT_ALLOWED"
      </code>
      
       | <code>
        "NOT_ACCEPTABLE"
      </code>
      
       | <code>
        "PROXY_AUTHENTICATION_REQUIRED"
      </code>
      
       | <code>
        "REQUEST_TIMEOUT"
      </code>
      
       | <code>
        "CONFLICT"
      </code>
      
       | <code>
        "GONE"
      </code>
      
       | <code>
        "LENGTH_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_FAILED"
      </code>
      
       | <code>
        "PAYLOAD_TOO_LARGE"
      </code>
      
       | <code>
        "URI_TOO_LONG"
      </code>
      
       | <code>
        "UNSUPPORTED_MEDIA_TYPE"
      </code>
      
       | <code>
        "RANGE_NOT_SATISFIABLE"
      </code>
      
       | <code>
        "EXPECTATION_FAILED"
      </code>
      
       | <code>
        "I'M_A_TEAPOT"
      </code>
      
       | <code>
        "MISDIRECTED_REQUEST"
      </code>
      
       | <code>
        "UNPROCESSABLE_ENTITY"
      </code>
      
       | <code>
        "LOCKED"
      </code>
      
       | <code>
        "FAILED_DEPENDENCY"
      </code>
      
       | <code>
        "TOO_EARLY"
      </code>
      
       | <code>
        "UPGRADE_REQUIRED"
      </code>
      
       | <code>
        "PRECONDITION_REQUIRED"
      </code>
      
       | <code>
        "TOO_MANY_REQUESTS"
      </code>
      
       | <code>
        "REQUEST_HEADER_FIELDS_TOO_LARGE"
      </code>
      
       | <code>
        "UNAVAILABLE_FOR_LEGAL_REASONS"
      </code>
      
       | <code>
        "INTERNAL_SERVER_ERROR"
      </code>
      
       | <code>
        "NOT_IMPLEMENTED"
      </code>
      
       | <code>
        "BAD_GATEWAY"
      </code>
      
       | <code>
        "SERVICE_UNAVAILABLE"
      </code>
      
       | <code>
        "GATEWAY_TIMEOUT"
      </code>
      
       | <code>
        "HTTP_VERSION_NOT_SUPPORTED"
      </code>
      
       | <code>
        "VARIANT_ALSO_NEGOTIATES"
      </code>
      
       | <code>
        "INSUFFICIENT_STORAGE"
      </code>
      
       | <code>
        "LOOP_DETECTED"
      </code>
      
       | <code>
        "NOT_EXTENDED"
      </code>
      
       | <code>
        "NETWORK_AUTHENTICATION_REQUIRED"
      </code>
      
       | <code>
        undefined
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error
      </code>
    </td>
    
    <td>
      { <code>
        code
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        message
      </code>
      
      : <code>
        string
      </code>
      
      ; }
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error.code
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        error.message
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

###### Returns

[`APIError`](#apierror)

## Interfaces

### AuthMutationCtx

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

A DataModel-independent Convex context that can run mutations / queries and
schedule work — what the auth email / rate-limit / lifecycle integrations
receive. Auth email flows execute inside a mutation/action, so the request
ctx is narrowed to one of these. Kept structural (rather than
`GenericMutationCtx<DM>`) so a context for *any* data model is assignable.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="runmutation">
        
      </a>
      
       <code>
        runMutation
      </code>
    </td>
    
    <td>
      <<code>
        Mutation
      </code>
      
      >(<code>
        mutation
      </code>
      
      , ...<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        FunctionReturnType
      </code>
      
      <<code>
        Mutation
      </code>
      
      >>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="runquery">
        
      </a>
      
       <code>
        runQuery
      </code>
    </td>
    
    <td>
      <<code>
        Query
      </code>
      
      >(<code>
        query
      </code>
      
      , ...<code>
        args
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        FunctionReturnType
      </code>
      
      <<code>
        Query
      </code>
      
      >>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="scheduler">
        
      </a>
      
       <code>
        scheduler
      </code>
    </td>
    
    <td>
      <code>
        Scheduler
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### AuthRateLimiter

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Guards auth-sensitive flows. Satisfied by `setupRateLimiter(...)` from
`nuxt-backend/rate-limit` (which seeds these named limits).

#### Methods

##### limit()

```ts
limit(
   ctx, 
   name, 
   options?
): Promise<{
  ok: boolean;
  retryAfter?: number;
}>;
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

###### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ctx
      </code>
    </td>
    
    <td>
      <code>
        Pick
      </code>
      
      <<a href="#authmutationctx">
        <code>
          AuthMutationCtx
        </code>
      </a>
      
      , <code>
        "runQuery"
      </code>
      
       | <code>
        "runMutation"
      </code>
      
      >
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      <a href="#authratelimitname">
        <code>
          AuthRateLimitName
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      { <code>
        key?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        throws?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options.key?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options.throws?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
  </tr>
</tbody>
</table>

###### Returns

`Promise`<{
`ok`: `boolean`;
`retryAfter?`: `number`;
}>

---

### AuthCreatedUser

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

The newly-created user passed to [AuthIntegrations.onUserCreated](#onusercreated-1).

#### 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/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.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/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name-1">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### AuthDeletedUser

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

The user just deleted, passed to [AuthIntegrations.onUserDeleted](#onuserdeleted-1).

#### 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/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="email-1">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name-2">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### CanSignInInput

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

What [CanSignIn](#cansignin) is asked about.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="email-2">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The address, as Better Auth holds it (lower-cased).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="isnewuser">
        
      </a>
      
       <code>
        isNewUser
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
      
       when no account exists for the address yet.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="purpose">
        
      </a>
      
       <code>
        purpose
      </code>
    </td>
    
    <td>
      <a href="#cansigninpurpose">
        <code>
          CanSignInPurpose
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### AuthIntegrations

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

The cross-component part of [SetupAuthOptions](#setupauthoptions): the `email`
instance every auth email goes out through (required), a `rateLimiter` to
throttle sending and checking codes and the privileged routes, `canSignIn`
to gate who may sign in or sign up, and `onUserCreated` / `onUserDeleted`
to run side effects (durable workflows, analytics, erasure) around the
account lifecycle. A code or an invitation the deployment cannot deliver —
no `EMAIL_API_KEY`, test mode, no `EMAIL_FROM` — is refused on the request,
with a message the form shows and the setting to change in the logs (set
`NUXT_BACKEND_LOG_OTP=1` to echo codes to the console during local dev
instead).

#### Extended by

- [`SetupAuthOptions`](#setupauthoptions)

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
    
    <th>
      Default type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-dm-3">
        
      </a>
      
       <code>
        DM
      </code>
      
       <em>
        extends
      </em>
      
       <code>
        GenericDataModel
      </code>
    </td>
    
    <td>
      <code>
        GenericDataModel
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="email-3">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <a href="#authemail">
        <code>
          AuthEmail
        </code>
      </a>
    </td>
    
    <td>
      The app's <code>
        setupEmail
      </code>
      
       instance: the sign-in codes and every other auth email go out through it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="ratelimiter">
        
      </a>
      
       <code>
        rateLimiter?
      </code>
    </td>
    
    <td>
      <a href="#authratelimiter">
        <code>
          AuthRateLimiter
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="onusercreated-1">
        
      </a>
      
       <code>
        onUserCreated?
      </code>
    </td>
    
    <td>
      <a href="#onusercreated">
        <code>
          OnUserCreated
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cansignin-1">
        
      </a>
      
       <code>
        canSignIn?
      </code>
    </td>
    
    <td>
      <a href="#cansignin">
        <code>
          CanSignIn
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
    
    <td>
      Gate sign-in / sign-up (invite-only, allow-list, closed beta). See <a href="#cansignin">
        CanSignIn
      </a>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="onuserdeleted-1">
        
      </a>
      
       <code>
        onUserDeleted?
      </code>
    </td>
    
    <td>
      <a href="#onuserdeleted">
        <code>
          OnUserDeleted
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
    
    <td>
      Fired after an account is deleted, after any consumer <code>
        afterDelete
      </code>
      
      . See <a href="#onuserdeleted">
        OnUserDeleted
      </a>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### McpAuthOptions

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Options for the agent (MCP) OAuth provider — better-auth's `mcp` plugin.
Agents obtain access via dynamic client registration + the OAuth
authorization-code flow with PKCE, and every authorization goes through
the consent page, where the person approves or denies. All of it is mounted
under the auth base path and reachable on the app origin through the base
module's auth proxy.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="scopes">
        
      </a>
      
       <code>
        scopes?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      Extra OAuth scopes on top of the built-in set, <code>
        BACKEND_MCP_SCOPES
      </code>
      
       (identity scopes plus the built-in tool scopes, always offered).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="loginpath">
        
      </a>
      
       <code>
        loginPath?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The app page a person signs in on mid-authorization. Default <code>
        /login
      </code>
      
      ; keep it equal to <code>
        backend.pages.login
      </code>
      
       (<code>
        nuxt-backend doctor
      </code>
      
       compares the two).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="consentpath">
        
      </a>
      
       <code>
        consentPath?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The app page a person approves or denies an agent on. Default <code>
        /oauth/consent
      </code>
      
      ; keep it equal to <code>
        backend.pages.agentConsent
      </code>
      
       (<code>
        nuxt-backend doctor
      </code>
      
       compares the two).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### SetupAuthOptions

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Everything `setupAuth` takes: the auth library's own options, the bundled
plugins' options, and the cross-component wiring of [AuthIntegrations](#authintegrations).

#### Extends

- [`AuthIntegrations`](#authintegrations)<`DM`>

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
    
    <th>
      Default type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-dm-4">
        
      </a>
      
       <code>
        DM
      </code>
      
       <em>
        extends
      </em>
      
       <code>
        GenericDataModel
      </code>
    </td>
    
    <td>
      <code>
        GenericDataModel
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="email-4">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <a href="#authemail">
        <code>
          AuthEmail
        </code>
      </a>
    </td>
    
    <td>
      The app's <code>
        setupEmail
      </code>
      
       instance: the sign-in codes and every other auth email go out through it.
    </td>
    
    <td>
      <a href="#authintegrations">
        <code>
          AuthIntegrations
        </code>
      </a>
      
      .<a href="#email-3">
        <code>
          email
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="ratelimiter-1">
        
      </a>
      
       <code>
        rateLimiter?
      </code>
    </td>
    
    <td>
      <a href="#authratelimiter">
        <code>
          AuthRateLimiter
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#authintegrations">
        <code>
          AuthIntegrations
        </code>
      </a>
      
      .<a href="#ratelimiter">
        <code>
          rateLimiter
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="onusercreated-2">
        
      </a>
      
       <code>
        onUserCreated?
      </code>
    </td>
    
    <td>
      <a href="#onusercreated">
        <code>
          OnUserCreated
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#authintegrations">
        <code>
          AuthIntegrations
        </code>
      </a>
      
      .<a href="#onusercreated-1">
        <code>
          onUserCreated
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cansignin-2">
        
      </a>
      
       <code>
        canSignIn?
      </code>
    </td>
    
    <td>
      <a href="#cansignin">
        <code>
          CanSignIn
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
    
    <td>
      Gate sign-in / sign-up (invite-only, allow-list, closed beta). See <a href="#cansignin">
        CanSignIn
      </a>
      
      .
    </td>
    
    <td>
      <a href="#authintegrations">
        <code>
          AuthIntegrations
        </code>
      </a>
      
      .<a href="#cansignin-1">
        <code>
          canSignIn
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="onuserdeleted-2">
        
      </a>
      
       <code>
        onUserDeleted?
      </code>
    </td>
    
    <td>
      <a href="#onuserdeleted">
        <code>
          OnUserDeleted
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
    
    <td>
      Fired after an account is deleted, after any consumer <code>
        afterDelete
      </code>
      
      . See <a href="#onuserdeleted">
        OnUserDeleted
      </a>
      
      .
    </td>
    
    <td>
      <a href="#authintegrations">
        <code>
          AuthIntegrations
        </code>
      </a>
      
      .<a href="#onuserdeleted-1">
        <code>
          onUserDeleted
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="authconfig">
        
      </a>
      
       <code>
        authConfig?
      </code>
    </td>
    
    <td>
      <code>
        AuthConfig
      </code>
    </td>
    
    <td>
      Override the default auth config (e.g. to add custom providers)
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="authoptions">
        
      </a>
      
       <code>
        authOptions?
      </code>
    </td>
    
    <td>
      <code>
        BetterAuthOptions
      </code>
    </td>
    
    <td>
      Override Better Auth options (merged with defaults)
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="basepath">
        
      </a>
      
       <code>
        basePath?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Override Better Auth basePath and matching Convex auth route
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="admin">
        
      </a>
      
       <code>
        admin?
      </code>
    </td>
    
    <td>
      <code>
        AdminOptions
      </code>
    </td>
    
    <td>
      Admin plugin options: roles via <code>
        adminRoles
      </code>
      
      /<code>
        ac
      </code>
      
      , ban, impersonation.
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organization">
        
      </a>
      
       <code>
        organization?
      </code>
    </td>
    
    <td>
      <code>
        OrganizationOptions
      </code>
      
       & { <code>
        invitationPath?
      </code>
      
      : <code>
        string
      </code>
      
      ; }
    </td>
    
    <td>
      Organization (workspace) plugin options.
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="mcp">
        
      </a>
      
       <code>
        mcp?
      </code>
    </td>
    
    <td>
      <a href="#mcpauthoptions">
        <code>
          McpAuthOptions
        </code>
      </a>
    </td>
    
    <td>
      Agent (MCP) OAuth provider options: the provider behind the app's OAuth-protected MCP endpoint and the <code>
        /mcp/exchange
      </code>
      
       token mint.
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### AuthSetupComponents

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

The component handles the auth setup reads from your generated `components`
object. Pass the whole object — the `backend` key is picked structurally.

`backend` is the package's all-in-one component: its `adapter` module is the
Better Auth CRUD surface. Auth email goes out through the `email` option
(see [AuthIntegrations](#authintegrations)).

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="backend">
        
      </a>
      
       <code>
        backend
      </code>
    </td>
    
    <td>
      <code>
        PublicAuthComponentRef
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### DeviceSession

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

One of the caller's device sessions, as `listSessions` returns it.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </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>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="useragent">
        
      </a>
      
       <code>
        userAgent
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="createdat">
        
      </a>
      
       <code>
        createdAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="updatedat">
        
      </a>
      
       <code>
        updatedAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="expiresat">
        
      </a>
      
       <code>
        expiresAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      Epoch ms; a session past it no longer signs anyone in.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="current">
        
      </a>
      
       <code>
        current
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether this is the session the caller is signed in with.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### McpExchange

Defined in: [src/convex/integrations/mcp.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/mcp.ts)

The agent token exchange `setupAuth` returns as `mcp`, for `registerBackendRoutes({ auth })`.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="exchangehandler">
        
      </a>
      
       <code>
        exchangeHandler
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        request
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        Response
      </code>
      
      >
    </td>
    
    <td>
      httpAction body for <code>
        POST /mcp/exchange
      </code>
      
       (wrapped by <code>
        registerBackendRoutes
      </code>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/mcp.ts" rel="nofollow">
        src/convex/integrations/mcp.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Type Aliases

### AuthEmail

```ts
type AuthEmail = Pick<Email, "sendTemplate">;
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

What the auth flows send their email through: the app's `setupEmail`
instance, which holds the templates and sends through the package's own
transport (the `backend` component's email module, on Resend). Restyle
the sign-in code, welcome, account-deletion and invitation emails there,
with `setupEmail(components, { templates })`.

---

### AuthRateLimitName

```ts
type AuthRateLimitName = 
  | "emailOtp"
  | "emailOtpGlobal"
  | "emailOtpAttempt"
  | "emailChange"
  | "mcp"
  | "admin"
  | "invitation"
  | "invitationGlobal"
  | "agentRegistrationGlobal";
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

The named rate limits the auth flows consult (a subset of the defaults):
code sends — per email (`emailOtp`, keyed by a SHA-256 of the address) and
deployment-wide (`emailOtpGlobal`, the backstop against mass probing) —
code checks per address (`emailOtpAttempt`, keyed the same way), the
agent token exchange `setupAuth` wires from the same options, the
privileged routes throttled per caller (`admin`, `invitation`, and
`emailChange` for the code an email change sends to the new address) with
a deployment-wide ceiling behind the last two (`invitationGlobal`,
`emailOtpGlobal`), and the anonymous agent registration route
(`agentRegistrationGlobal`).

---

### OnUserCreated

```ts
type OnUserCreated<DM> = (ctx, user) => Promise<void>;
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Fired once after a user is created — e.g. to kick off a welcome workflow.
Receives the full request ctx (a mutation or action ctx for your data model),
so it can `runMutation`, schedule work, or start a Workflow.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
    
    <th>
      Default type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-dm">
        
      </a>
      
       <code>
        DM
      </code>
      
       <em>
        extends
      </em>
      
       <code>
        GenericDataModel
      </code>
    </td>
    
    <td>
      <code>
        GenericDataModel
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ctx
      </code>
    </td>
    
    <td>
      <code>
        GenericMutationCtx
      </code>
      
      <<code>
        DM
      </code>
      
      > | <code>
        GenericActionCtx
      </code>
      
      <<code>
        DM
      </code>
      
      >
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        user
      </code>
    </td>
    
    <td>
      <a href="#authcreateduser">
        <code>
          AuthCreatedUser
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`Promise`<`void`>

---

### OnUserDeleted

```ts
type OnUserDeleted<DM> = (ctx, user) => Promise<void>;
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Fired once after a user account is deleted (the `deleteUser` flow, confirmed
via email when a transport is wired) — e.g. to erase the app's own rows for
that user, or the billing cache via `billing.forgetEntity`. Runs after a
consumer-supplied `user.deleteUser.afterDelete`.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
    
    <th>
      Default type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-dm-1">
        
      </a>
      
       <code>
        DM
      </code>
      
       <em>
        extends
      </em>
      
       <code>
        GenericDataModel
      </code>
    </td>
    
    <td>
      <code>
        GenericDataModel
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ctx
      </code>
    </td>
    
    <td>
      <code>
        GenericMutationCtx
      </code>
      
      <<code>
        DM
      </code>
      
      > | <code>
        GenericActionCtx
      </code>
      
      <<code>
        DM
      </code>
      
      >
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        user
      </code>
    </td>
    
    <td>
      <a href="#authdeleteduser">
        <code>
          AuthDeletedUser
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`Promise`<`void`>

---

### CanSignInPurpose

```ts
type CanSignInPurpose = "sign-in" | "user-create" | "session" | "email-change";
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Where a [CanSignIn](#cansignin) verdict is being asked for:

- `'sign-in'` — an OTP sign-in code was requested for the address, before
anything is sent. `isNewUser` says whether the address has an account.
- `'user-create'` — an account is about to be created (any path).
`isNewUser` is always `true`.
- `'session'` — a session is about to be created for an existing account
(OTP verification, passkey sign-in, …). `isNewUser` is always `false`.
- `'email-change'` — a signed-in account asks to move to `email`, its new
address: before a code goes to it, and again before the account moves.
`isNewUser` is always `false`: the person already has an account.

---

### CanSignInVerdict

```ts
type CanSignInVerdict = 
  | true
  | {
  allowed: false;
  message?: string;
};
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

A [CanSignIn](#cansignin) verdict: `true` to allow, or a refusal with an optional
message shown to the user (default: "Sign-in is by invitation right now.").

---

### CanSignIn

```ts
type CanSignIn<DM> = (ctx, input) => Promise<CanSignInVerdict>;
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Gate sign-in and account creation — e.g. an invite-only launch, an
allow-list, or a closed beta. Consulted (with the full request ctx, so it
can query the app's own tables) before an OTP is sent for a sign-in
request, before any account is created, before a session is created for an
existing account, and before an account moves to a new address (see
[CanSignInPurpose](#cansigninpurpose)). A refusal surfaces as a `FORBIDDEN` `APIError`
with the verdict's message — `useLoginFlow().error` shows it.

A refusal at `'sign-in'` answers whoever typed the address, so a gate that
refuses new addresses there tells anyone which addresses have an account.
To keep that private, allow every `'sign-in'` and refuse at
`'user-create'`: only the person holding the mailbox, who has the code,
reads that refusal.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
    
    <th>
      Default type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-dm-2">
        
      </a>
      
       <code>
        DM
      </code>
      
       <em>
        extends
      </em>
      
       <code>
        GenericDataModel
      </code>
    </td>
    
    <td>
      <code>
        GenericDataModel
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ctx
      </code>
    </td>
    
    <td>
      <code>
        GenericMutationCtx
      </code>
      
      <<code>
        DM
      </code>
      
      > | <code>
        GenericActionCtx
      </code>
      
      <<code>
        DM
      </code>
      
      >
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        input
      </code>
    </td>
    
    <td>
      <a href="#cansignininput">
        <code>
          CanSignInInput
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`Promise`<[`CanSignInVerdict`](#cansigninverdict)>

---

### AdminPluginOptions

```ts
type AdminPluginOptions = Parameters<typeof admin>[0];
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Options for the bundled admin plugin (roles, permissions, ban, impersonation).

---

### OrganizationPluginOptions

```ts
type OrganizationPluginOptions = Parameters<typeof organization>[0] & {
  invitationPath?: string;
};
```

Defined in: [src/convex/client/auth-types.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts)

Options for the bundled organization plugin (workspaces). Every user gets a
personal workspace on first sign-in, set active, so `activeOrganizationId`
is never null. Beyond the plugin's own options:

- `invitationPath` — the app page invitation emails link to (default
`/accept-invitation`, registered automatically by the Nuxt module). The
emailed URL is `{SITE_URL}{invitationPath}?id=<invitationId>`.
⚠ Declared in two places by necessity: keep it aligned with the Nuxt
side's `backend.pages.acceptInvitation` (nuxt.config) — a mismatch 404s
invitees, and `nuxt-backend doctor` cross-checks both.

#### Type Declaration

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

<tbody>
  <tr>
    <td>
      <code>
        invitationPath?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/auth-types.ts" rel="nofollow">
        src/convex/client/auth-types.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Functions

### setupAuth()

```ts
function setupAuth<DM>(
   components, 
   queryBuilder, 
   options
): {
  getAuthUser: RegisteredQuery<"public", {
   }, Promise<{
     _creationTime: number;
     _id: Id<"user">;
     image?: string | null;
     role?: string | null;
     banned?: boolean | null;
     banReason?: string | null;
     banExpires?: number | null;
     userId?: string | null;
     name: string;
     email: string;
     emailVerified: boolean;
     createdAt: number;
     updatedAt: number;
  }>>;
  authConfig: RegisteredQuery<"public", {
   }, Promise<{
     invitationPath: string;
     agentLoginPath: string;
     agentConsentPath: string;
  }>>;
  listWorkspaces: RegisteredQuery<"public", {
   }, Promise<
     | {
     id: string;
     name: string;
     slug: string;
     logo: string | null;
     role: string;
     active: boolean;
     joinedAt: number;
   }[]
    | null>>;
  listWorkspaceMembers: RegisteredQuery<"public", {
     organizationId?: string;
   }, Promise<
     | {
     organizationId: string;
     members: {
        userId: string;
        name: string;
        email: string;
        role: string;
        joinedAt: number;
     }[];
   }
    | null>>;
  updateProfile: RegisteredMutation<"public", {
     name: string;
  }, Promise<null>>;
  listSessions: RegisteredQuery<"public", {
  }, Promise<DeviceSession[] | null>>;
  revokeSession: RegisteredMutation<"public", {
     sessionId: string;
  }, Promise<null>>;
  authComponent: {
     adapter: (ctx) => AdapterFactory<BetterAuthOptions>;
     getAnyUserById: (ctx, id) => Promise<
        | {
        _creationTime: number;
        _id: Id<"user">;
        image?: string | null;
        role?: string | null;
        banned?: boolean | null;
        banReason?: string | null;
        banExpires?: number | null;
        userId?: string | null;
        name: string;
        email: string;
        emailVerified: boolean;
        createdAt: number;
        updatedAt: number;
      }
       | null>;
     setUserId: (ctx, authId, userId) => Promise<void>;
     triggersApi: () => {
        onCreate: RegisteredMutation<"internal", {
           model: string;
           doc: any;
        }, Promise<void>>;
        onUpdate: RegisteredMutation<"internal", {
           model: string;
           oldDoc: any;
           newDoc: any;
        }, Promise<void>>;
        onDelete: RegisteredMutation<"internal", {
           model: string;
           doc: any;
        }, Promise<void>>;
     };
     registerRoutes: (http, createAuth, opts?) => void;
     registerRoutesLazy: <T>(http, createAuth, opts?) => void;
     safeGetAuthUser: (ctx) => Promise<
        | {
        _creationTime: number;
        _id: Id<"user">;
        image?: string | null;
        role?: string | null;
        banned?: boolean | null;
        banReason?: string | null;
        banExpires?: number | null;
        userId?: string | null;
        name: string;
        email: string;
        emailVerified: boolean;
        createdAt: number;
        updatedAt: number;
      }
       | undefined>;
     getAuthUser: (ctx) => Promise<{
        _creationTime: number;
        _id: Id<"user">;
        image?: string | null;
        role?: string | null;
        banned?: boolean | null;
        banReason?: string | null;
        banExpires?: number | null;
        userId?: string | null;
        name: string;
        email: string;
        emailVerified: boolean;
        createdAt: number;
        updatedAt: number;
     }>;
     getHeaders: (ctx) => Promise<Headers>;
     getAuth: <T>(createAuth, ctx) => Promise<{
        auth: ReturnType<T>;
        headers: Headers;
     }>;
     clientApi: () => {
        getAuthUser: RegisteredQuery<"public", {
         }, Promise<{
           _creationTime: number;
           _id: Id<"user">;
           image?: string | null;
           role?: string | null;
           banned?: boolean | null;
           banReason?: string | null;
           banExpires?: number | null;
           userId?: string | null;
           name: string;
           email: string;
           emailVerified: boolean;
           createdAt: number;
           updatedAt: number;
        }>>;
     };
  };
  createAuth: (ctx) => Auth<{
     appName?: string;
     baseURL?: BaseURLConfig;
     secret?: string;
     secrets?: {
        version: number;
        value: string;
     }[];
     secondaryStorage?: SecondaryStorage;
     emailVerification?: {
        sendVerificationEmail?: (data, request?) => Promise<void>;
        sendOnSignUp?: boolean;
        sendOnSignIn?: boolean;
        autoSignInAfterVerification?: boolean;
        expiresIn?: number;
        beforeEmailVerification?: (user, request?) => Promise<void>;
        afterEmailVerification?: (user, request?) => Promise<void>;
     };
     socialProviders?: SocialProviders;
     session?: BetterAuthDBOptions<"session", 
        | "id"
        | "createdAt"
        | "updatedAt"
        | "userId"
        | "expiresAt"
        | "token"
        | "ipAddress"
        | "userAgent"> & {
        expiresIn?: number;
        updateAge?: number;
        disableSessionRefresh?: boolean;
        deferSessionRefresh?: boolean;
        storeSessionInDatabase?: boolean;
        preserveSessionInDatabase?: boolean;
        cookieCache?: {
           maxAge?: number;
           enabled?: boolean;
           strategy?: "jwt" | "compact" | "jwe";
           refreshCache?:   | boolean
              | {
              updateAge?: ...;
            };
           version?: string | ((session, user) => ...) | ((session, user) => ...);
        };
        freshAge?: number;
     };
     account?: BetterAuthDBOptions<"account", 
        | "id"
        | "createdAt"
        | "updatedAt"
        | "userId"
        | "accountId"
        | "providerId"
        | "accessToken"
        | "refreshToken"
        | "idToken"
        | "accessTokenExpiresAt"
        | "refreshTokenExpiresAt"
        | "scope"
        | "password"> & {
        updateAccountOnSignIn?: boolean;
        accountLinking?: {
           enabled?: boolean;
           disableImplicitLinking?: boolean;
           requireLocalEmailVerified?: boolean;
           trustedProviders?: ...[] | ((request?) => ...);
           allowDifferentEmails?: boolean;
           allowUnlinkingAll?: boolean;
           updateUserInfoOnLink?: boolean;
        };
        encryptOAuthTokens?: boolean;
        skipStateCookieCheck?: boolean;
        storeStateStrategy?: "database" | "cookie";
        storeAccountCookie?: boolean;
     };
     verification?: BetterAuthDBOptions<"verification", "id" | "createdAt" | "updatedAt" | "expiresAt" | "identifier" | "value"> & {
        disableCleanup?: boolean;
        storeIdentifier?:   | StoreIdentifierOption
           | {
           default: StoreIdentifierOption;
           overrides?: Record<..., ...>;
         };
        storeInDatabase?: boolean;
     };
     trustedOrigins?:   | string[]
        | ((request?) => Awaitable<(string | null | undefined)[]>);
     advanced?: BetterAuthAdvancedOptions;
     logger?: Logger;
     databaseHooks?: {
        user?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
        session?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
        account?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
        verification?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
     };
     onAPIError?: {
        throw?: boolean;
        onError?: (error, ctx) => void | Promise<void>;
        errorURL?: string;
        customizeDefaultErrorPage?: {
           colors?: {
              background?: ... | ...;
              foreground?: ... | ...;
              primary?: ... | ...;
              primaryForeground?: ... | ...;
              mutedForeground?: ... | ...;
              border?: ... | ...;
              destructive?: ... | ...;
              titleBorder?: ... | ...;
              titleColor?: ... | ...;
              gridColor?: ... | ...;
              cardBackground?: ... | ...;
              cornerBorder?: ... | ...;
           };
           size?: {
              radiusSm?: ... | ...;
              radiusMd?: ... | ...;
              radiusLg?: ... | ...;
              textSm?: ... | ...;
              text2xl?: ... | ...;
              text4xl?: ... | ...;
              text6xl?: ... | ...;
           };
           font?: {
              defaultFamily?: ... | ...;
              monoFamily?: ... | ...;
           };
           disableTitleBorder?: boolean;
           disableCornerDecorations?: boolean;
           disableBackgroundGrid?: boolean;
        };
     };
     telemetry?: {
        enabled?: boolean;
        debug?: boolean;
     };
     experimental?: {
        joins?: boolean;
        instrumentation?: {
           enabled?: boolean;
        };
     };
     basePath: string;
     database: AdapterFactory<BetterAuthOptions>;
     disabledPaths: string[];
     emailAndPassword: {
        disableSignUp?: boolean;
        requireEmailVerification?: boolean;
        maxPasswordLength?: number;
        minPasswordLength?: number;
        sendResetPassword?: (data, request?) => Promise<void>;
        resetPasswordTokenExpiresIn?: number;
        onPasswordReset?: (data, request?) => Promise<void>;
        password?: {
           hash?: (password) => Promise<string>;
           verify?: (data) => Promise<boolean>;
        };
        autoSignIn?: boolean;
        revokeSessionsOnPasswordReset?: boolean;
        onExistingUserSignUp?: (data, request?) => Promise<void>;
        customSyntheticUser?: (params) => Record<string, unknown>;
        enabled: boolean;
     };
     user: {
        modelName?: "user" | LiteralString;
        fields?: Partial<Record<"name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt", string>>;
        additionalFields?: {
         [key: string]: DBFieldAttribute;
        };
        changeEmail?: {
           enabled: boolean;
           sendChangeEmailConfirmation?: (data, request?) => Promise<void>;
           updateEmailWithoutVerification?: boolean;
        };
        deleteUser?: {
           enabled?: boolean;
           sendDeleteAccountVerification?: (data, request?) => Promise<void>;
           beforeDelete?: (user, request?) => Promise<void>;
           afterDelete?: (user, request?) => Promise<void>;
           deleteTokenExpiresIn?: number;
        };
     };
     rateLimit: {
        window?: number;
        max?: number;
        modelName?: "rateLimit" | LiteralString;
        fields?: Partial<Record<"key" | "count" | "lastRequest", string>>;
        customRules?: {
         [key: string]: 
           | false
           | BetterAuthRateLimitRule
           | ((request, currentRule) => Awaitable<... | ...>);
        };
        storage?: "memory" | "database" | "secondary-storage";
        customStorage?: BetterAuthRateLimitStorage;
        enabled: boolean;
     };
     hooks:   | {
        before?: MiddlewareHandler;
        after?: MiddlewareHandler;
      }
        | undefined;
     plugins: [{
        id: "convex";
        version: string;
        init: (ctx) => void;
        hooks: {
           before: (
              | {
              matcher(context): boolean;
              handler: (inputContext) => ...;
            }
              | {
              matcher: (ctx) => ...;
              handler: (inputContext) => ...;
           })[];
           after: {
              matcher: (context) => boolean;
              handler: MiddlewareHandler;
           }[];
        };
        endpoints: {
           getOpenIdConfig: StrictEndpoint<"/convex/.well-known/openid-configuration", {
              method: "GET";
              metadata: {
                 isAction: false;
              };
           }, OIDCMetadata>;
           getJwks: StrictEndpoint<"/convex/jwks", {
              method: "GET";
              metadata: {
                 openapi: {
                    description: ...;
                    responses: ...;
                 };
              };
           }, JSONWebKeySet>;
           getLatestJwks: StrictEndpoint<"/convex/latest-jwks", {
              isAction: boolean;
              method: "POST";
              metadata: {
                 SERVER_ONLY: true;
                 openapi: {
                    description: ...;
                 };
              };
           }, any[]>;
           rotateKeys: StrictEndpoint<"/convex/rotate-keys", {
              isAction: boolean;
              method: "POST";
              metadata: {
                 SERVER_ONLY: true;
                 openapi: {
                    description: ...;
                 };
              };
           }, any[]>;
           getToken: StrictEndpoint<"/convex/token", {
              method: "GET";
              requireHeaders: true;
              use: ((inputContext) => ...)[];
              metadata: {
                 openapi: {
                    description: ...;
                    responses: ...;
                 };
              };
            }, {
              token: string;
           }>;
        };
        schema: {
           jwks: {
              fields: {
                 publicKey: {
                    type: "string";
                    required: true;
                 };
                 privateKey: {
                    type: "string";
                    required: true;
                 };
                 createdAt: {
                    type: "date";
                    required: true;
                 };
                 expiresAt: {
                    type: "date";
                    required: false;
                 };
              };
           };
           user: {
              fields: {
                 userId: {
                    type: "string";
                    required: false;
                    input: false;
                 };
              };
           };
        };
     }, ...(BetterAuthPlugin | { id: "email-otp"; version: string; init: any; endpoints: { sendVerificationOTP: StrictEndpoint<"/email-otp/send-verification-otp", { method: "POST"; use: (...)[]; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; createVerificationOTP: StrictEndpoint<string, { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, string>; getVerificationOTP: StrictEndpoint<string, { method: "GET"; query: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { otp: ... } | { otp: ... }>; checkVerificationOTP: StrictEndpoint<"/email-otp/check-verification-otp", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; verifyEmailOTP: StrictEndpoint<"/email-otp/verify-email", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { status: ...; token: ...; user: ... } | { status: ...; token: ...; user: ... }>; signInEmailOTP: StrictEndpoint<"/sign-in/email-otp", { method: "POST"; body: ZodIntersection<(...), (...)>; metadata: { openapi: ... } }, { token: string; user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... } }>; requestPasswordResetEmailOTP: StrictEndpoint<"/email-otp/request-password-reset", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; forgetPasswordEmailOTP: StrictEndpoint<"/forget-password/email-otp", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; resetPasswordEmailOTP: StrictEndpoint<"/email-otp/reset-password", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; requestEmailChangeEmailOTP: StrictEndpoint<"/email-otp/request-email-change", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; changeEmailEmailOTP: StrictEndpoint<"/email-otp/change-email", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }> }; hooks: { after: { matcher: any; handler: Middleware<(...), (...)> }[] }; rateLimit: ({ pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number })[]; options: EmailOTPOptions; $ERROR_CODES: { OTP_EXPIRED: RawError<"OTP_EXPIRED">; INVALID_OTP: RawError<"INVALID_OTP">; TOO_MANY_ATTEMPTS: RawError<"TOO_MANY_ATTEMPTS"> } } | { id: "passkey"; version: string; endpoints: { generatePasskeyRegistrationOptions: StrictEndpoint<"/passkey/generate-register-options", { method: "GET"; use: (...)[]; query: ZodOptional<(...)>; metadata: { openapi: ... } }, PublicKeyCredentialCreationOptionsJSON>; generatePasskeyAuthenticationOptions: StrictEndpoint<"/passkey/generate-authenticate-options", { method: "GET"; metadata: { openapi: ... } }, PublicKeyCredentialRequestOptionsJSON>; verifyPasskeyRegistration: StrictEndpoint<"/passkey/verify-registration", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, Passkey>; verifyPasskeyAuthentication: StrictEndpoint<"/passkey/verify-authentication", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { session: { id: ...; createdAt: ...; updatedAt: ...; userId: ...; expiresAt: ...; token: ...; ipAddress?: ...; userAgent?: ... }; user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... } }>; listPasskeys: StrictEndpoint<"/passkey/list-user-passkeys", { method: "GET"; use: (...)[]; metadata: { openapi: ... } }, Passkey[]>; deletePasskey: StrictEndpoint<"/passkey/delete-passkey", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { status: boolean }>; updatePasskey: StrictEndpoint<"/passkey/update-passkey", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { passkey: Passkey }> }; schema: { passkey: { fields: { name: { type: ...; required: ... }; publicKey: { type: ...; required: ... }; userId: { type: ...; references: ...; required: ...; index: ... }; credentialID: { type: ...; required: ...; index: ... }; counter: { type: ...; required: ... }; deviceType: { type: ...; required: ... }; backedUp: { type: ...; required: ... }; transports: { type: ...; required: ... }; createdAt: { type: ...; required: ... }; aaguid: { type: ...; required: ... } } } }; $ERROR_CODES: { CHALLENGE_NOT_FOUND: RawError<"CHALLENGE_NOT_FOUND">; YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">; FAILED_TO_VERIFY_REGISTRATION: RawError<"FAILED_TO_VERIFY_REGISTRATION">; PASSKEY_NOT_FOUND: RawError<"PASSKEY_NOT_FOUND">; AUTHENTICATION_FAILED: RawError<"AUTHENTICATION_FAILED">; UNABLE_TO_CREATE_SESSION: RawError<"UNABLE_TO_CREATE_SESSION">; FAILED_TO_UPDATE_PASSKEY: RawError<"FAILED_TO_UPDATE_PASSKEY">; PREVIOUSLY_REGISTERED: RawError<"PREVIOUSLY_REGISTERED">; REGISTRATION_CANCELLED: RawError<"REGISTRATION_CANCELLED">; AUTH_CANCELLED: RawError<"AUTH_CANCELLED">; UNKNOWN_ERROR: RawError<"UNKNOWN_ERROR">; SESSION_REQUIRED: RawError<"SESSION_REQUIRED">; RESOLVE_USER_REQUIRED: RawError<"RESOLVE_USER_REQUIRED">; RESOLVED_USER_INVALID: RawError<"RESOLVED_USER_INVALID"> }; options: PasskeyOptions | undefined } | { id: "admin"; version: string; init: any; hooks: { after: { matcher: any; handler: Middleware<(...), (...)> }[] }; endpoints: { setRole: StrictEndpoint<"/admin/set-role", { method: "POST"; body: ZodObject<(...), (...)>; requireHeaders: true; use: (...)[]; metadata: { openapi: ...; $Infer: ... } }, { user: UserWithRole }>; getUser: StrictEndpoint<"/admin/get-user", { method: "GET"; query: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, UserWithRole>; createUser: StrictEndpoint<"/admin/create-user", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { user: UserWithRole }>; adminUpdateUser: StrictEndpoint<"/admin/update-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, UserWithRole>; listUsers: StrictEndpoint<"/admin/list-users", { method: "GET"; use: (...)[]; query: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { users: (...)[]; total: number }>; listUserSessions: StrictEndpoint<"/admin/list-user-sessions", { method: "POST"; use: (...)[]; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { sessions: (...)[] }>; unbanUser: StrictEndpoint<"/admin/unban-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { user: UserWithRole }>; banUser: StrictEndpoint<"/admin/ban-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { user: UserWithRole }>; impersonateUser: StrictEndpoint<"/admin/impersonate-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { session: { id: ...; createdAt: ...; updatedAt: ...; userId: ...; expiresAt: ...; token: ...; ipAddress?: ...; userAgent?: ... }; user: UserWithRole }>; stopImpersonating: StrictEndpoint<"/admin/stop-impersonating", { method: "POST"; requireHeaders: true }, { session: (...) & (...); user: (...) & (...) }>; revokeUserSession: StrictEndpoint<"/admin/revoke-user-session", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; revokeUserSessions: StrictEndpoint<"/admin/revoke-user-sessions", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; removeUser: StrictEndpoint<"/admin/remove-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; setUserPassword: StrictEndpoint<"/admin/set-user-password", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { status: boolean }>; userHasPermission: StrictEndpoint<"/admin/has-permission", { method: "POST"; body: ZodIntersection<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { error: null; success: boolean }> }; $ERROR_CODES: { USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">; FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">; USER_ALREADY_EXISTS: RawError<"USER_ALREADY_EXISTS">; YOU_CANNOT_BAN_YOURSELF: RawError<"YOU_CANNOT_BAN_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">; YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">; YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">; BANNED_USER: RawError<"BANNED_USER">; YOU_ARE_NOT_ALLOWED_TO_GET_USER: RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">; NO_DATA_TO_UPDATE: RawError<"NO_DATA_TO_UPDATE">; YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">; YOU_CANNOT_REMOVE_YOURSELF: RawError<"YOU_CANNOT_REMOVE_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">; YOU_CANNOT_IMPERSONATE_ADMINS: RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">; INVALID_ROLE_TYPE: RawError<"INVALID_ROLE_TYPE">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">; PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER"> }; schema: { user: { fields: { role: { type: ...; required: ...; input: ... }; banned: { type: ...; defaultValue: ...; required: ...; input: ... }; banReason: { type: ...; required: ...; input: ... }; banExpires: { type: ...; required: ...; input: ... } } }; session: { fields: { impersonatedBy: { type: ...; required: ...; input: ... } } } }; options: NoInfer<AdminOptions> } | DefaultOrganizationPlugin<{ allowUserToCreateOrganization?: boolean | ((user: (...) & (...)) => Awaitable<(...)>); organizationLimit?: number | ((user: (...) & (...)) => Awaitable<(...)>); creatorRole?: string; membershipLimit?: number | ((user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... }, organization: { id: ...; name: ...; slug: ...; logo?: ...; metadata?: ...; createdAt: ... }) => (...) | (...)); ac?: AccessControl; roles?: { [key: string]: (...) | (...) }; dynamicAccessControl?: { enabled?: (...) | (...) | (...); maximumRolesPerOrganization?: (...) | (...) | (...) }; teams?: { enabled: boolean; defaultTeam?: (...) | (...); maximumTeams?: (...) | (...) | (...); maximumMembersPerTeam?: (...) | (...) | (...); allowRemovingAllTeams?: (...) | (...) | (...) }; invitationExpiresIn?: number; invitationLimit?: number | ((data: { user: ...; organization: ...; member: ... }, ctx: AuthContext) => Awaitable<(...)>); cancelPendingInvitationsOnReInvite?: boolean; requireEmailVerificationOnInvitation?: boolean; sendInvitationEmail?: (data: { id: ...; role: ...; email: ...; organization: ...; invitation: ...; inviter: ... }, request?: (...) | (...)) => Promise<(...)>; schema?: { session?: (...) | (...); organization?: (...) | (...); member?: (...) | (...); invitation?: (...) | (...); team?: (...) | (...); teamMember?: (...) | (...); organizationRole?: (...) | (...) }; disableOrganizationDeletion?: boolean; organizationHooks?: { beforeCreateOrganization?: (...) | (...); afterCreateOrganization?: (...) | (...); beforeUpdateOrganization?: (...) | (...); afterUpdateOrganization?: (...) | (...); beforeDeleteOrganization?: (...) | (...); afterDeleteOrganization?: (...) | (...); beforeAddMember?: (...) | (...); afterAddMember?: (...) | (...); beforeRemoveMember?: (...) | (...); afterRemoveMember?: (...) | (...); beforeUpdateMemberRole?: (...) | (...); afterUpdateMemberRole?: (...) | (...); beforeCreateInvitation?: (...) | (...); afterCreateInvitation?: (...) | (...); beforeAcceptInvitation?: (...) | (...); afterAcceptInvitation?: (...) | (...); beforeRejectInvitation?: (...) | (...); afterRejectInvitation?: (...) | (...); beforeCancelInvitation?: (...) | (...); afterCancelInvitation?: (...) | (...); beforeCreateTeam?: (...) | (...); afterCreateTeam?: (...) | (...); beforeUpdateTeam?: (...) | (...); afterUpdateTeam?: (...) | (...); beforeDeleteTeam?: (...) | (...); afterDeleteTeam?: (...) | (...); beforeAddTeamMember?: (...) | (...); afterAddTeamMember?: (...) | (...); beforeRemoveTeamMember?: (...) | (...); afterRemoveTeamMember?: (...) | (...) } }>)[]];
  }>;
  mcp: McpExchange;
};
```

Defined in: [src/convex/client/index.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts)

The app's auth, from one call: the auth instance factory, the functions the
scaffold re-exports, and the agent token exchange. Every auth email goes
out through the `email` instance, with the templates it holds.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-dm-5">
        
      </a>
      
       <code>
        DM
      </code>
      
       <em>
        extends
      </em>
      
       <code>
        GenericDataModel
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        components
      </code>
    </td>
    
    <td>
      <a href="#authsetupcomponents">
        <code>
          AuthSetupComponents
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        queryBuilder
      </code>
    </td>
    
    <td>
      <code>
        QueryBuilder
      </code>
      
      <<code>
        DM
      </code>
      
      , <code>
        "public"
      </code>
      
      >
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options
      </code>
    </td>
    
    <td>
      <a href="#setupauthoptions">
        <code>
          SetupAuthOptions
        </code>
      </a>
      
      <<code>
        DM
      </code>
      
      >
    </td>
  </tr>
</tbody>
</table>

#### Returns

```ts
{
  getAuthUser: RegisteredQuery<"public", {
   }, Promise<{
     _creationTime: number;
     _id: Id<"user">;
     image?: string | null;
     role?: string | null;
     banned?: boolean | null;
     banReason?: string | null;
     banExpires?: number | null;
     userId?: string | null;
     name: string;
     email: string;
     emailVerified: boolean;
     createdAt: number;
     updatedAt: number;
  }>>;
  authConfig: RegisteredQuery<"public", {
   }, Promise<{
     invitationPath: string;
     agentLoginPath: string;
     agentConsentPath: string;
  }>>;
  listWorkspaces: RegisteredQuery<"public", {
   }, Promise<
     | {
     id: string;
     name: string;
     slug: string;
     logo: string | null;
     role: string;
     active: boolean;
     joinedAt: number;
   }[]
    | null>>;
  listWorkspaceMembers: RegisteredQuery<"public", {
     organizationId?: string;
   }, Promise<
     | {
     organizationId: string;
     members: {
        userId: string;
        name: string;
        email: string;
        role: string;
        joinedAt: number;
     }[];
   }
    | null>>;
  updateProfile: RegisteredMutation<"public", {
     name: string;
  }, Promise<null>>;
  listSessions: RegisteredQuery<"public", {
  }, Promise<DeviceSession[] | null>>;
  revokeSession: RegisteredMutation<"public", {
     sessionId: string;
  }, Promise<null>>;
  authComponent: {
     adapter: (ctx) => AdapterFactory<BetterAuthOptions>;
     getAnyUserById: (ctx, id) => Promise<
        | {
        _creationTime: number;
        _id: Id<"user">;
        image?: string | null;
        role?: string | null;
        banned?: boolean | null;
        banReason?: string | null;
        banExpires?: number | null;
        userId?: string | null;
        name: string;
        email: string;
        emailVerified: boolean;
        createdAt: number;
        updatedAt: number;
      }
       | null>;
     setUserId: (ctx, authId, userId) => Promise<void>;
     triggersApi: () => {
        onCreate: RegisteredMutation<"internal", {
           model: string;
           doc: any;
        }, Promise<void>>;
        onUpdate: RegisteredMutation<"internal", {
           model: string;
           oldDoc: any;
           newDoc: any;
        }, Promise<void>>;
        onDelete: RegisteredMutation<"internal", {
           model: string;
           doc: any;
        }, Promise<void>>;
     };
     registerRoutes: (http, createAuth, opts?) => void;
     registerRoutesLazy: <T>(http, createAuth, opts?) => void;
     safeGetAuthUser: (ctx) => Promise<
        | {
        _creationTime: number;
        _id: Id<"user">;
        image?: string | null;
        role?: string | null;
        banned?: boolean | null;
        banReason?: string | null;
        banExpires?: number | null;
        userId?: string | null;
        name: string;
        email: string;
        emailVerified: boolean;
        createdAt: number;
        updatedAt: number;
      }
       | undefined>;
     getAuthUser: (ctx) => Promise<{
        _creationTime: number;
        _id: Id<"user">;
        image?: string | null;
        role?: string | null;
        banned?: boolean | null;
        banReason?: string | null;
        banExpires?: number | null;
        userId?: string | null;
        name: string;
        email: string;
        emailVerified: boolean;
        createdAt: number;
        updatedAt: number;
     }>;
     getHeaders: (ctx) => Promise<Headers>;
     getAuth: <T>(createAuth, ctx) => Promise<{
        auth: ReturnType<T>;
        headers: Headers;
     }>;
     clientApi: () => {
        getAuthUser: RegisteredQuery<"public", {
         }, Promise<{
           _creationTime: number;
           _id: Id<"user">;
           image?: string | null;
           role?: string | null;
           banned?: boolean | null;
           banReason?: string | null;
           banExpires?: number | null;
           userId?: string | null;
           name: string;
           email: string;
           emailVerified: boolean;
           createdAt: number;
           updatedAt: number;
        }>>;
     };
  };
  createAuth: (ctx) => Auth<{
     appName?: string;
     baseURL?: BaseURLConfig;
     secret?: string;
     secrets?: {
        version: number;
        value: string;
     }[];
     secondaryStorage?: SecondaryStorage;
     emailVerification?: {
        sendVerificationEmail?: (data, request?) => Promise<void>;
        sendOnSignUp?: boolean;
        sendOnSignIn?: boolean;
        autoSignInAfterVerification?: boolean;
        expiresIn?: number;
        beforeEmailVerification?: (user, request?) => Promise<void>;
        afterEmailVerification?: (user, request?) => Promise<void>;
     };
     socialProviders?: SocialProviders;
     session?: BetterAuthDBOptions<"session", 
        | "id"
        | "createdAt"
        | "updatedAt"
        | "userId"
        | "expiresAt"
        | "token"
        | "ipAddress"
        | "userAgent"> & {
        expiresIn?: number;
        updateAge?: number;
        disableSessionRefresh?: boolean;
        deferSessionRefresh?: boolean;
        storeSessionInDatabase?: boolean;
        preserveSessionInDatabase?: boolean;
        cookieCache?: {
           maxAge?: number;
           enabled?: boolean;
           strategy?: "jwt" | "compact" | "jwe";
           refreshCache?:   | boolean
              | {
              updateAge?: ...;
            };
           version?: string | ((session, user) => ...) | ((session, user) => ...);
        };
        freshAge?: number;
     };
     account?: BetterAuthDBOptions<"account", 
        | "id"
        | "createdAt"
        | "updatedAt"
        | "userId"
        | "accountId"
        | "providerId"
        | "accessToken"
        | "refreshToken"
        | "idToken"
        | "accessTokenExpiresAt"
        | "refreshTokenExpiresAt"
        | "scope"
        | "password"> & {
        updateAccountOnSignIn?: boolean;
        accountLinking?: {
           enabled?: boolean;
           disableImplicitLinking?: boolean;
           requireLocalEmailVerified?: boolean;
           trustedProviders?: ...[] | ((request?) => ...);
           allowDifferentEmails?: boolean;
           allowUnlinkingAll?: boolean;
           updateUserInfoOnLink?: boolean;
        };
        encryptOAuthTokens?: boolean;
        skipStateCookieCheck?: boolean;
        storeStateStrategy?: "database" | "cookie";
        storeAccountCookie?: boolean;
     };
     verification?: BetterAuthDBOptions<"verification", "id" | "createdAt" | "updatedAt" | "expiresAt" | "identifier" | "value"> & {
        disableCleanup?: boolean;
        storeIdentifier?:   | StoreIdentifierOption
           | {
           default: StoreIdentifierOption;
           overrides?: Record<..., ...>;
         };
        storeInDatabase?: boolean;
     };
     trustedOrigins?:   | string[]
        | ((request?) => Awaitable<(string | null | undefined)[]>);
     advanced?: BetterAuthAdvancedOptions;
     logger?: Logger;
     databaseHooks?: {
        user?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
        session?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
        account?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
        verification?: {
           create?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           update?: {
              before?: ... | ...;
              after?: ... | ...;
           };
           delete?: {
              before?: ... | ...;
              after?: ... | ...;
           };
        };
     };
     onAPIError?: {
        throw?: boolean;
        onError?: (error, ctx) => void | Promise<void>;
        errorURL?: string;
        customizeDefaultErrorPage?: {
           colors?: {
              background?: ... | ...;
              foreground?: ... | ...;
              primary?: ... | ...;
              primaryForeground?: ... | ...;
              mutedForeground?: ... | ...;
              border?: ... | ...;
              destructive?: ... | ...;
              titleBorder?: ... | ...;
              titleColor?: ... | ...;
              gridColor?: ... | ...;
              cardBackground?: ... | ...;
              cornerBorder?: ... | ...;
           };
           size?: {
              radiusSm?: ... | ...;
              radiusMd?: ... | ...;
              radiusLg?: ... | ...;
              textSm?: ... | ...;
              text2xl?: ... | ...;
              text4xl?: ... | ...;
              text6xl?: ... | ...;
           };
           font?: {
              defaultFamily?: ... | ...;
              monoFamily?: ... | ...;
           };
           disableTitleBorder?: boolean;
           disableCornerDecorations?: boolean;
           disableBackgroundGrid?: boolean;
        };
     };
     telemetry?: {
        enabled?: boolean;
        debug?: boolean;
     };
     experimental?: {
        joins?: boolean;
        instrumentation?: {
           enabled?: boolean;
        };
     };
     basePath: string;
     database: AdapterFactory<BetterAuthOptions>;
     disabledPaths: string[];
     emailAndPassword: {
        disableSignUp?: boolean;
        requireEmailVerification?: boolean;
        maxPasswordLength?: number;
        minPasswordLength?: number;
        sendResetPassword?: (data, request?) => Promise<void>;
        resetPasswordTokenExpiresIn?: number;
        onPasswordReset?: (data, request?) => Promise<void>;
        password?: {
           hash?: (password) => Promise<string>;
           verify?: (data) => Promise<boolean>;
        };
        autoSignIn?: boolean;
        revokeSessionsOnPasswordReset?: boolean;
        onExistingUserSignUp?: (data, request?) => Promise<void>;
        customSyntheticUser?: (params) => Record<string, unknown>;
        enabled: boolean;
     };
     user: {
        modelName?: "user" | LiteralString;
        fields?: Partial<Record<"name" | "email" | "emailVerified" | "image" | "createdAt" | "updatedAt", string>>;
        additionalFields?: {
         [key: string]: DBFieldAttribute;
        };
        changeEmail?: {
           enabled: boolean;
           sendChangeEmailConfirmation?: (data, request?) => Promise<void>;
           updateEmailWithoutVerification?: boolean;
        };
        deleteUser?: {
           enabled?: boolean;
           sendDeleteAccountVerification?: (data, request?) => Promise<void>;
           beforeDelete?: (user, request?) => Promise<void>;
           afterDelete?: (user, request?) => Promise<void>;
           deleteTokenExpiresIn?: number;
        };
     };
     rateLimit: {
        window?: number;
        max?: number;
        modelName?: "rateLimit" | LiteralString;
        fields?: Partial<Record<"key" | "count" | "lastRequest", string>>;
        customRules?: {
         [key: string]: 
           | false
           | BetterAuthRateLimitRule
           | ((request, currentRule) => Awaitable<... | ...>);
        };
        storage?: "memory" | "database" | "secondary-storage";
        customStorage?: BetterAuthRateLimitStorage;
        enabled: boolean;
     };
     hooks:   | {
        before?: MiddlewareHandler;
        after?: MiddlewareHandler;
      }
        | undefined;
     plugins: [{
        id: "convex";
        version: string;
        init: (ctx) => void;
        hooks: {
           before: (
              | {
              matcher(context): boolean;
              handler: (inputContext) => ...;
            }
              | {
              matcher: (ctx) => ...;
              handler: (inputContext) => ...;
           })[];
           after: {
              matcher: (context) => boolean;
              handler: MiddlewareHandler;
           }[];
        };
        endpoints: {
           getOpenIdConfig: StrictEndpoint<"/convex/.well-known/openid-configuration", {
              method: "GET";
              metadata: {
                 isAction: false;
              };
           }, OIDCMetadata>;
           getJwks: StrictEndpoint<"/convex/jwks", {
              method: "GET";
              metadata: {
                 openapi: {
                    description: ...;
                    responses: ...;
                 };
              };
           }, JSONWebKeySet>;
           getLatestJwks: StrictEndpoint<"/convex/latest-jwks", {
              isAction: boolean;
              method: "POST";
              metadata: {
                 SERVER_ONLY: true;
                 openapi: {
                    description: ...;
                 };
              };
           }, any[]>;
           rotateKeys: StrictEndpoint<"/convex/rotate-keys", {
              isAction: boolean;
              method: "POST";
              metadata: {
                 SERVER_ONLY: true;
                 openapi: {
                    description: ...;
                 };
              };
           }, any[]>;
           getToken: StrictEndpoint<"/convex/token", {
              method: "GET";
              requireHeaders: true;
              use: ((inputContext) => ...)[];
              metadata: {
                 openapi: {
                    description: ...;
                    responses: ...;
                 };
              };
            }, {
              token: string;
           }>;
        };
        schema: {
           jwks: {
              fields: {
                 publicKey: {
                    type: "string";
                    required: true;
                 };
                 privateKey: {
                    type: "string";
                    required: true;
                 };
                 createdAt: {
                    type: "date";
                    required: true;
                 };
                 expiresAt: {
                    type: "date";
                    required: false;
                 };
              };
           };
           user: {
              fields: {
                 userId: {
                    type: "string";
                    required: false;
                    input: false;
                 };
              };
           };
        };
     }, ...(BetterAuthPlugin | { id: "email-otp"; version: string; init: any; endpoints: { sendVerificationOTP: StrictEndpoint<"/email-otp/send-verification-otp", { method: "POST"; use: (...)[]; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; createVerificationOTP: StrictEndpoint<string, { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, string>; getVerificationOTP: StrictEndpoint<string, { method: "GET"; query: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { otp: ... } | { otp: ... }>; checkVerificationOTP: StrictEndpoint<"/email-otp/check-verification-otp", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; verifyEmailOTP: StrictEndpoint<"/email-otp/verify-email", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { status: ...; token: ...; user: ... } | { status: ...; token: ...; user: ... }>; signInEmailOTP: StrictEndpoint<"/sign-in/email-otp", { method: "POST"; body: ZodIntersection<(...), (...)>; metadata: { openapi: ... } }, { token: string; user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... } }>; requestPasswordResetEmailOTP: StrictEndpoint<"/email-otp/request-password-reset", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; forgetPasswordEmailOTP: StrictEndpoint<"/forget-password/email-otp", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; resetPasswordEmailOTP: StrictEndpoint<"/email-otp/reset-password", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; requestEmailChangeEmailOTP: StrictEndpoint<"/email-otp/request-email-change", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; changeEmailEmailOTP: StrictEndpoint<"/email-otp/change-email", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }> }; hooks: { after: { matcher: any; handler: Middleware<(...), (...)> }[] }; rateLimit: ({ pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number })[]; options: EmailOTPOptions; $ERROR_CODES: { OTP_EXPIRED: RawError<"OTP_EXPIRED">; INVALID_OTP: RawError<"INVALID_OTP">; TOO_MANY_ATTEMPTS: RawError<"TOO_MANY_ATTEMPTS"> } } | { id: "passkey"; version: string; endpoints: { generatePasskeyRegistrationOptions: StrictEndpoint<"/passkey/generate-register-options", { method: "GET"; use: (...)[]; query: ZodOptional<(...)>; metadata: { openapi: ... } }, PublicKeyCredentialCreationOptionsJSON>; generatePasskeyAuthenticationOptions: StrictEndpoint<"/passkey/generate-authenticate-options", { method: "GET"; metadata: { openapi: ... } }, PublicKeyCredentialRequestOptionsJSON>; verifyPasskeyRegistration: StrictEndpoint<"/passkey/verify-registration", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, Passkey>; verifyPasskeyAuthentication: StrictEndpoint<"/passkey/verify-authentication", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { session: { id: ...; createdAt: ...; updatedAt: ...; userId: ...; expiresAt: ...; token: ...; ipAddress?: ...; userAgent?: ... }; user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... } }>; listPasskeys: StrictEndpoint<"/passkey/list-user-passkeys", { method: "GET"; use: (...)[]; metadata: { openapi: ... } }, Passkey[]>; deletePasskey: StrictEndpoint<"/passkey/delete-passkey", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { status: boolean }>; updatePasskey: StrictEndpoint<"/passkey/update-passkey", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { passkey: Passkey }> }; schema: { passkey: { fields: { name: { type: ...; required: ... }; publicKey: { type: ...; required: ... }; userId: { type: ...; references: ...; required: ...; index: ... }; credentialID: { type: ...; required: ...; index: ... }; counter: { type: ...; required: ... }; deviceType: { type: ...; required: ... }; backedUp: { type: ...; required: ... }; transports: { type: ...; required: ... }; createdAt: { type: ...; required: ... }; aaguid: { type: ...; required: ... } } } }; $ERROR_CODES: { CHALLENGE_NOT_FOUND: RawError<"CHALLENGE_NOT_FOUND">; YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">; FAILED_TO_VERIFY_REGISTRATION: RawError<"FAILED_TO_VERIFY_REGISTRATION">; PASSKEY_NOT_FOUND: RawError<"PASSKEY_NOT_FOUND">; AUTHENTICATION_FAILED: RawError<"AUTHENTICATION_FAILED">; UNABLE_TO_CREATE_SESSION: RawError<"UNABLE_TO_CREATE_SESSION">; FAILED_TO_UPDATE_PASSKEY: RawError<"FAILED_TO_UPDATE_PASSKEY">; PREVIOUSLY_REGISTERED: RawError<"PREVIOUSLY_REGISTERED">; REGISTRATION_CANCELLED: RawError<"REGISTRATION_CANCELLED">; AUTH_CANCELLED: RawError<"AUTH_CANCELLED">; UNKNOWN_ERROR: RawError<"UNKNOWN_ERROR">; SESSION_REQUIRED: RawError<"SESSION_REQUIRED">; RESOLVE_USER_REQUIRED: RawError<"RESOLVE_USER_REQUIRED">; RESOLVED_USER_INVALID: RawError<"RESOLVED_USER_INVALID"> }; options: PasskeyOptions | undefined } | { id: "admin"; version: string; init: any; hooks: { after: { matcher: any; handler: Middleware<(...), (...)> }[] }; endpoints: { setRole: StrictEndpoint<"/admin/set-role", { method: "POST"; body: ZodObject<(...), (...)>; requireHeaders: true; use: (...)[]; metadata: { openapi: ...; $Infer: ... } }, { user: UserWithRole }>; getUser: StrictEndpoint<"/admin/get-user", { method: "GET"; query: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, UserWithRole>; createUser: StrictEndpoint<"/admin/create-user", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { user: UserWithRole }>; adminUpdateUser: StrictEndpoint<"/admin/update-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, UserWithRole>; listUsers: StrictEndpoint<"/admin/list-users", { method: "GET"; use: (...)[]; query: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { users: (...)[]; total: number }>; listUserSessions: StrictEndpoint<"/admin/list-user-sessions", { method: "POST"; use: (...)[]; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { sessions: (...)[] }>; unbanUser: StrictEndpoint<"/admin/unban-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { user: UserWithRole }>; banUser: StrictEndpoint<"/admin/ban-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { user: UserWithRole }>; impersonateUser: StrictEndpoint<"/admin/impersonate-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { session: { id: ...; createdAt: ...; updatedAt: ...; userId: ...; expiresAt: ...; token: ...; ipAddress?: ...; userAgent?: ... }; user: UserWithRole }>; stopImpersonating: StrictEndpoint<"/admin/stop-impersonating", { method: "POST"; requireHeaders: true }, { session: (...) & (...); user: (...) & (...) }>; revokeUserSession: StrictEndpoint<"/admin/revoke-user-session", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; revokeUserSessions: StrictEndpoint<"/admin/revoke-user-sessions", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; removeUser: StrictEndpoint<"/admin/remove-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; setUserPassword: StrictEndpoint<"/admin/set-user-password", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { status: boolean }>; userHasPermission: StrictEndpoint<"/admin/has-permission", { method: "POST"; body: ZodIntersection<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { error: null; success: boolean }> }; $ERROR_CODES: { USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">; FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">; USER_ALREADY_EXISTS: RawError<"USER_ALREADY_EXISTS">; YOU_CANNOT_BAN_YOURSELF: RawError<"YOU_CANNOT_BAN_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">; YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">; YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">; BANNED_USER: RawError<"BANNED_USER">; YOU_ARE_NOT_ALLOWED_TO_GET_USER: RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">; NO_DATA_TO_UPDATE: RawError<"NO_DATA_TO_UPDATE">; YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">; YOU_CANNOT_REMOVE_YOURSELF: RawError<"YOU_CANNOT_REMOVE_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">; YOU_CANNOT_IMPERSONATE_ADMINS: RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">; INVALID_ROLE_TYPE: RawError<"INVALID_ROLE_TYPE">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">; PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER"> }; schema: { user: { fields: { role: { type: ...; required: ...; input: ... }; banned: { type: ...; defaultValue: ...; required: ...; input: ... }; banReason: { type: ...; required: ...; input: ... }; banExpires: { type: ...; required: ...; input: ... } } }; session: { fields: { impersonatedBy: { type: ...; required: ...; input: ... } } } }; options: NoInfer<AdminOptions> } | DefaultOrganizationPlugin<{ allowUserToCreateOrganization?: boolean | ((user: (...) & (...)) => Awaitable<(...)>); organizationLimit?: number | ((user: (...) & (...)) => Awaitable<(...)>); creatorRole?: string; membershipLimit?: number | ((user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... }, organization: { id: ...; name: ...; slug: ...; logo?: ...; metadata?: ...; createdAt: ... }) => (...) | (...)); ac?: AccessControl; roles?: { [key: string]: (...) | (...) }; dynamicAccessControl?: { enabled?: (...) | (...) | (...); maximumRolesPerOrganization?: (...) | (...) | (...) }; teams?: { enabled: boolean; defaultTeam?: (...) | (...); maximumTeams?: (...) | (...) | (...); maximumMembersPerTeam?: (...) | (...) | (...); allowRemovingAllTeams?: (...) | (...) | (...) }; invitationExpiresIn?: number; invitationLimit?: number | ((data: { user: ...; organization: ...; member: ... }, ctx: AuthContext) => Awaitable<(...)>); cancelPendingInvitationsOnReInvite?: boolean; requireEmailVerificationOnInvitation?: boolean; sendInvitationEmail?: (data: { id: ...; role: ...; email: ...; organization: ...; invitation: ...; inviter: ... }, request?: (...) | (...)) => Promise<(...)>; schema?: { session?: (...) | (...); organization?: (...) | (...); member?: (...) | (...); invitation?: (...) | (...); team?: (...) | (...); teamMember?: (...) | (...); organizationRole?: (...) | (...) }; disableOrganizationDeletion?: boolean; organizationHooks?: { beforeCreateOrganization?: (...) | (...); afterCreateOrganization?: (...) | (...); beforeUpdateOrganization?: (...) | (...); afterUpdateOrganization?: (...) | (...); beforeDeleteOrganization?: (...) | (...); afterDeleteOrganization?: (...) | (...); beforeAddMember?: (...) | (...); afterAddMember?: (...) | (...); beforeRemoveMember?: (...) | (...); afterRemoveMember?: (...) | (...); beforeUpdateMemberRole?: (...) | (...); afterUpdateMemberRole?: (...) | (...); beforeCreateInvitation?: (...) | (...); afterCreateInvitation?: (...) | (...); beforeAcceptInvitation?: (...) | (...); afterAcceptInvitation?: (...) | (...); beforeRejectInvitation?: (...) | (...); afterRejectInvitation?: (...) | (...); beforeCancelInvitation?: (...) | (...); afterCancelInvitation?: (...) | (...); beforeCreateTeam?: (...) | (...); afterCreateTeam?: (...) | (...); beforeUpdateTeam?: (...) | (...); afterUpdateTeam?: (...) | (...); beforeDeleteTeam?: (...) | (...); afterDeleteTeam?: (...) | (...); beforeAddTeamMember?: (...) | (...); afterAddTeamMember?: (...) | (...); beforeRemoveTeamMember?: (...) | (...); afterRemoveTeamMember?: (...) | (...) } }>)[]];
  }>;
  mcp: McpExchange;
}
```

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

<tbody>
  <tr>
    <td>
      <code>
        getAuthUser
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { }, <code>
        Promise
      </code>
      
      <{ <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }>>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authConfig
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { }, <code>
        Promise
      </code>
      
      <{ <code>
        invitationPath
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        agentLoginPath
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        agentConsentPath
      </code>
      
      : <code>
        string
      </code>
      
      ; }>>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        listWorkspaces
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { }, <code>
        Promise
      </code>
      
      < | { <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        slug
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        logo
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        active
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        joinedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }<span>
        
      </span>
      
       | <code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        listWorkspaceMembers
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        organizationId?
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      < | { <code>
        organizationId
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        members
      </code>
      
      : { <code>
        userId
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        role
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        joinedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }<span>
        
      </span>
      
      ; } | <code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updateProfile
      </code>
    </td>
    
    <td>
      <code>
        RegisteredMutation
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        listSessions
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { }, <code>
        Promise
      </code>
      
      <<a href="#devicesession">
        <code>
          DeviceSession
        </code>
      </a>
      
      <span>
        
      </span>
      
       | <code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        revokeSession
      </code>
    </td>
    
    <td>
      <code>
        RegisteredMutation
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        sessionId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent
      </code>
    </td>
    
    <td>
      { <code>
        adapter
      </code>
      
      : (<code>
        ctx
      </code>
      
      ) => <code>
        AdapterFactory
      </code>
      
      <<code>
        BetterAuthOptions
      </code>
      
      >; <code>
        getAnyUserById
      </code>
      
      : (<code>
        ctx
      </code>
      
      , <code>
        id
      </code>
      
      ) => <code>
        Promise
      </code>
      
      < | { <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; } | <code>
        null
      </code>
      
      >; <code>
        setUserId
      </code>
      
      : (<code>
        ctx
      </code>
      
      , <code>
        authId
      </code>
      
      , <code>
        userId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        triggersApi
      </code>
      
      : () => { <code>
        onCreate
      </code>
      
      : <code>
        RegisteredMutation
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        model
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        doc
      </code>
      
      : <code>
        any
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >>; <code>
        onUpdate
      </code>
      
      : <code>
        RegisteredMutation
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        model
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        oldDoc
      </code>
      
      : <code>
        any
      </code>
      
      ; <code>
        newDoc
      </code>
      
      : <code>
        any
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >>; <code>
        onDelete
      </code>
      
      : <code>
        RegisteredMutation
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        model
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        doc
      </code>
      
      : <code>
        any
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >>; }; <code>
        registerRoutes
      </code>
      
      : (<code>
        http
      </code>
      
      , <code>
        createAuth
      </code>
      
      , <code>
        opts?
      </code>
      
      ) => <code>
        void
      </code>
      
      ; <code>
        registerRoutesLazy
      </code>
      
      : <<code>
        T
      </code>
      
      >(<code>
        http
      </code>
      
      , <code>
        createAuth
      </code>
      
      , <code>
        opts?
      </code>
      
      ) => <code>
        void
      </code>
      
      ; <code>
        safeGetAuthUser
      </code>
      
      : (<code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      < | { <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; } | <code>
        undefined
      </code>
      
      >; <code>
        getAuthUser
      </code>
      
      : (<code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <{ <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }>; <code>
        getHeaders
      </code>
      
      : (<code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        Headers
      </code>
      
      >; <code>
        getAuth
      </code>
      
      : <<code>
        T
      </code>
      
      >(<code>
        createAuth
      </code>
      
      , <code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <{ <code>
        auth
      </code>
      
      : <code>
        ReturnType
      </code>
      
      <<code>
        T
      </code>
      
      >; <code>
        headers
      </code>
      
      : <code>
        Headers
      </code>
      
      ; }>; <code>
        clientApi
      </code>
      
      : () => { <code>
        getAuthUser
      </code>
      
      : <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { }, <code>
        Promise
      </code>
      
      <{ <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }>>; }; }
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.adapter()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      ) => <code>
        AdapterFactory
      </code>
      
      <<code>
        BetterAuthOptions
      </code>
      
      >
    </td>
    
    <td>
      Returns the Convex database adapter for use in Better Auth options.
    </td>
    
    <td>
      node_modules/@convex-dev/better-auth/dist/client/create-client.d.ts:87
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.getAnyUserById()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        id
      </code>
      
      ) => <code>
        Promise
      </code>
      
      < | { <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; } | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Returns a user by their Better Auth user id.
    </td>
    
    <td>
      node_modules/@convex-dev/better-auth/dist/client/create-client.d.ts:132
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.setUserId()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        authId
      </code>
      
      , <code>
        userId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Replaces 0.7 behavior of returning a new user id from onCreateUser <strong>
        Deprecated
      </strong>
      
       in 0.9
    </td>
    
    <td>
      node_modules/@convex-dev/better-auth/dist/client/create-client.d.ts:141
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.triggersApi()
      </code>
    </td>
    
    <td>
      () => { <code>
        onCreate
      </code>
      
      : <code>
        RegisteredMutation
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        model
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        doc
      </code>
      
      : <code>
        any
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >>; <code>
        onUpdate
      </code>
      
      : <code>
        RegisteredMutation
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        model
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        oldDoc
      </code>
      
      : <code>
        any
      </code>
      
      ; <code>
        newDoc
      </code>
      
      : <code>
        any
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >>; <code>
        onDelete
      </code>
      
      : <code>
        RegisteredMutation
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        model
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        doc
      </code>
      
      : <code>
        any
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >>; }
    </td>
    
    <td>
      Exposes functions for executing trigger callbacks in the app context. Callbacks are defined in the <code>
        triggers
      </code>
      
       option to the component client config. See <a href="https://labs.convex.dev/better-auth" rel="nofollow">
        createClient
      </a>
      
       for more information.
    </td>
    
    <td>
      node_modules/@convex-dev/better-auth/dist/client/create-client.d.ts:168
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.registerRoutes()
      </code>
    </td>
    
    <td>
      (<code>
        http
      </code>
      
      , <code>
        createAuth
      </code>
      
      , <code>
        opts?
      </code>
      
      ) => <code>
        void
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@convex-dev/better-auth/dist/client/create-client.d.ts:183
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.registerRoutesLazy()
      </code>
    </td>
    
    <td>
      <<code>
        T
      </code>
      
      >(<code>
        http
      </code>
      
      , <code>
        createAuth
      </code>
      
      , <code>
        opts?
      </code>
      
      ) => <code>
        void
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      node_modules/@convex-dev/better-auth/dist/client/create-client.d.ts:190
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.safeGetAuthUser()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      < | { <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; } | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/component.ts" rel="nofollow">
        src/convex/client/component.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.getAuthUser()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <{ <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/component.ts" rel="nofollow">
        src/convex/client/component.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.getHeaders()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        Headers
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/component.ts" rel="nofollow">
        src/convex/client/component.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.getAuth()
      </code>
    </td>
    
    <td>
      <<code>
        T
      </code>
      
      >(<code>
        createAuth
      </code>
      
      , <code>
        ctx
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <{ <code>
        auth
      </code>
      
      : <code>
        ReturnType
      </code>
      
      <<code>
        T
      </code>
      
      >; <code>
        headers
      </code>
      
      : <code>
        Headers
      </code>
      
      ; }>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/component.ts" rel="nofollow">
        src/convex/client/component.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        authComponent.clientApi()
      </code>
    </td>
    
    <td>
      () => { <code>
        getAuthUser
      </code>
      
      : <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { }, <code>
        Promise
      </code>
      
      <{ <code>
        _creationTime
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        _id
      </code>
      
      : <code>
        Id
      </code>
      
      <<code>
        "user"
      </code>
      
      >; <code>
        image?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        role?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banned?
      </code>
      
      : <code>
        boolean
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banReason?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        banExpires?
      </code>
      
      : <code>
        number
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        userId?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        email
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        emailVerified
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        createdAt
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updatedAt
      </code>
      
      : <code>
        number
      </code>
      
      ; }>>; }
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/component.ts" rel="nofollow">
        src/convex/client/component.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        createAuth()
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      ) => <code>
        Auth
      </code>
      
      <{ <code>
        appName?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        baseURL?
      </code>
      
      : <code>
        BaseURLConfig
      </code>
      
      ; <code>
        secret?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        secrets?
      </code>
      
      : { <code>
        version
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        value
      </code>
      
      : <code>
        string
      </code>
      
      ; }<span>
        
      </span>
      
      ; <code>
        secondaryStorage?
      </code>
      
      : <code>
        SecondaryStorage
      </code>
      
      ; <code>
        emailVerification?
      </code>
      
      : { <code>
        sendVerificationEmail?
      </code>
      
      : (<code>
        data
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        sendOnSignUp?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        sendOnSignIn?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        autoSignInAfterVerification?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        expiresIn?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        beforeEmailVerification?
      </code>
      
      : (<code>
        user
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        afterEmailVerification?
      </code>
      
      : (<code>
        user
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; }; <code>
        socialProviders?
      </code>
      
      : <code>
        SocialProviders
      </code>
      
      ; <code>
        session?
      </code>
      
      : <code>
        BetterAuthDBOptions
      </code>
      
      <<code>
        "session"
      </code>
      
      , | <code>
        "id"
      </code>
      
       | <code>
        "createdAt"
      </code>
      
       | <code>
        "updatedAt"
      </code>
      
       | <code>
        "userId"
      </code>
      
       | <code>
        "expiresAt"
      </code>
      
       | <code>
        "token"
      </code>
      
       | <code>
        "ipAddress"
      </code>
      
       | <code>
        "userAgent"
      </code>
      
      > & { <code>
        expiresIn?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        updateAge?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        disableSessionRefresh?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        deferSessionRefresh?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        storeSessionInDatabase?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        preserveSessionInDatabase?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        cookieCache?
      </code>
      
      : { <code>
        maxAge?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        enabled?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        strategy?
      </code>
      
      : <code>
        "jwt"
      </code>
      
       | <code>
        "compact"
      </code>
      
       | <code>
        "jwe"
      </code>
      
      ; <code>
        refreshCache?
      </code>
      
      : | <code>
        boolean
      </code>
      
       | { <code>
        updateAge?
      </code>
      
      : ...; }; <code>
        version?
      </code>
      
      : <code>
        string
      </code>
      
       | ((<code>
        session
      </code>
      
      , <code>
        user
      </code>
      
      ) => ...) | ((<code>
        session
      </code>
      
      , <code>
        user
      </code>
      
      ) => ...); }; <code>
        freshAge?
      </code>
      
      : <code>
        number
      </code>
      
      ; }; <code>
        account?
      </code>
      
      : <code>
        BetterAuthDBOptions
      </code>
      
      <<code>
        "account"
      </code>
      
      , | <code>
        "id"
      </code>
      
       | <code>
        "createdAt"
      </code>
      
       | <code>
        "updatedAt"
      </code>
      
       | <code>
        "userId"
      </code>
      
       | <code>
        "accountId"
      </code>
      
       | <code>
        "providerId"
      </code>
      
       | <code>
        "accessToken"
      </code>
      
       | <code>
        "refreshToken"
      </code>
      
       | <code>
        "idToken"
      </code>
      
       | <code>
        "accessTokenExpiresAt"
      </code>
      
       | <code>
        "refreshTokenExpiresAt"
      </code>
      
       | <code>
        "scope"
      </code>
      
       | <code>
        "password"
      </code>
      
      > & { <code>
        updateAccountOnSignIn?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        accountLinking?
      </code>
      
      : { <code>
        enabled?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        disableImplicitLinking?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        requireLocalEmailVerified?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        trustedProviders?
      </code>
      
      : ...<span>
        
      </span>
      
       | ((<code>
        request?
      </code>
      
      ) => ...); <code>
        allowDifferentEmails?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        allowUnlinkingAll?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        updateUserInfoOnLink?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        encryptOAuthTokens?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        skipStateCookieCheck?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        storeStateStrategy?
      </code>
      
      : <code>
        "database"
      </code>
      
       | <code>
        "cookie"
      </code>
      
      ; <code>
        storeAccountCookie?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        verification?
      </code>
      
      : <code>
        BetterAuthDBOptions
      </code>
      
      <<code>
        "verification"
      </code>
      
      , <code>
        "id"
      </code>
      
       | <code>
        "createdAt"
      </code>
      
       | <code>
        "updatedAt"
      </code>
      
       | <code>
        "expiresAt"
      </code>
      
       | <code>
        "identifier"
      </code>
      
       | <code>
        "value"
      </code>
      
      > & { <code>
        disableCleanup?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        storeIdentifier?
      </code>
      
      : | <code>
        StoreIdentifierOption
      </code>
      
       | { <code>
        default
      </code>
      
      : <code>
        StoreIdentifierOption
      </code>
      
      ; <code>
        overrides?
      </code>
      
      : <code>
        Record
      </code>
      
      <..., ...>; }; <code>
        storeInDatabase?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        trustedOrigins?
      </code>
      
      : | <code>
        string
      </code>
      
      <span>
        
      </span>
      
       | ((<code>
        request?
      </code>
      
      ) => <code>
        Awaitable
      </code>
      
      <(<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
       | <code>
        undefined
      </code>
      
      )<span>
        
      </span>
      
      >); <code>
        advanced?
      </code>
      
      : <code>
        BetterAuthAdvancedOptions
      </code>
      
      ; <code>
        logger?
      </code>
      
      : <code>
        Logger
      </code>
      
      ; <code>
        databaseHooks?
      </code>
      
      : { <code>
        user?
      </code>
      
      : { <code>
        create?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        update?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        delete?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; }; <code>
        session?
      </code>
      
      : { <code>
        create?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        update?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        delete?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; }; <code>
        account?
      </code>
      
      : { <code>
        create?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        update?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        delete?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; }; <code>
        verification?
      </code>
      
      : { <code>
        create?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        update?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; <code>
        delete?
      </code>
      
      : { <code>
        before?
      </code>
      
      : ... | ...; <code>
        after?
      </code>
      
      : ... | ...; }; }; }; <code>
        onAPIError?
      </code>
      
      : { <code>
        throw?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        onError?
      </code>
      
      : (<code>
        error
      </code>
      
      , <code>
        ctx
      </code>
      
      ) => <code>
        void
      </code>
      
       | <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        errorURL?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        customizeDefaultErrorPage?
      </code>
      
      : { <code>
        colors?
      </code>
      
      : { <code>
        background?
      </code>
      
      : ... | ...; <code>
        foreground?
      </code>
      
      : ... | ...; <code>
        primary?
      </code>
      
      : ... | ...; <code>
        primaryForeground?
      </code>
      
      : ... | ...; <code>
        mutedForeground?
      </code>
      
      : ... | ...; <code>
        border?
      </code>
      
      : ... | ...; <code>
        destructive?
      </code>
      
      : ... | ...; <code>
        titleBorder?
      </code>
      
      : ... | ...; <code>
        titleColor?
      </code>
      
      : ... | ...; <code>
        gridColor?
      </code>
      
      : ... | ...; <code>
        cardBackground?
      </code>
      
      : ... | ...; <code>
        cornerBorder?
      </code>
      
      : ... | ...; }; <code>
        size?
      </code>
      
      : { <code>
        radiusSm?
      </code>
      
      : ... | ...; <code>
        radiusMd?
      </code>
      
      : ... | ...; <code>
        radiusLg?
      </code>
      
      : ... | ...; <code>
        textSm?
      </code>
      
      : ... | ...; <code>
        text2xl?
      </code>
      
      : ... | ...; <code>
        text4xl?
      </code>
      
      : ... | ...; <code>
        text6xl?
      </code>
      
      : ... | ...; }; <code>
        font?
      </code>
      
      : { <code>
        defaultFamily?
      </code>
      
      : ... | ...; <code>
        monoFamily?
      </code>
      
      : ... | ...; }; <code>
        disableTitleBorder?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        disableCornerDecorations?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        disableBackgroundGrid?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; }; <code>
        telemetry?
      </code>
      
      : { <code>
        enabled?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        debug?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        experimental?
      </code>
      
      : { <code>
        joins?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        instrumentation?
      </code>
      
      : { <code>
        enabled?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; }; <code>
        basePath
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        database
      </code>
      
      : <code>
        AdapterFactory
      </code>
      
      <<code>
        BetterAuthOptions
      </code>
      
      >; <code>
        disabledPaths
      </code>
      
      : <code>
        string
      </code>
      
      <span>
        
      </span>
      
      ; <code>
        emailAndPassword
      </code>
      
      : { <code>
        disableSignUp?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        requireEmailVerification?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        maxPasswordLength?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        minPasswordLength?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        sendResetPassword?
      </code>
      
      : (<code>
        data
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        resetPasswordTokenExpiresIn?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        onPasswordReset?
      </code>
      
      : (<code>
        data
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        password?
      </code>
      
      : { <code>
        hash?
      </code>
      
      : (<code>
        password
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        string
      </code>
      
      >; <code>
        verify?
      </code>
      
      : (<code>
        data
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        boolean
      </code>
      
      >; }; <code>
        autoSignIn?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        revokeSessionsOnPasswordReset?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        onExistingUserSignUp?
      </code>
      
      : (<code>
        data
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        customSyntheticUser?
      </code>
      
      : (<code>
        params
      </code>
      
      ) => <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        unknown
      </code>
      
      >; <code>
        enabled
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        user
      </code>
      
      : { <code>
        modelName?
      </code>
      
      : <code>
        "user"
      </code>
      
       | <code>
        LiteralString
      </code>
      
      ; <code>
        fields?
      </code>
      
      : <code>
        Partial
      </code>
      
      <<code>
        Record
      </code>
      
      <<code>
        "name"
      </code>
      
       | <code>
        "email"
      </code>
      
       | <code>
        "emailVerified"
      </code>
      
       | <code>
        "image"
      </code>
      
       | <code>
        "createdAt"
      </code>
      
       | <code>
        "updatedAt"
      </code>
      
      , <code>
        string
      </code>
      
      >>; <code>
        additionalFields?
      </code>
      
      : { [<code>
        key
      </code>
      
      : <code>
        string
      </code>
      
      ]: <code>
        DBFieldAttribute
      </code>
      
      ; }; <code>
        changeEmail?
      </code>
      
      : { <code>
        enabled
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        sendChangeEmailConfirmation?
      </code>
      
      : (<code>
        data
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        updateEmailWithoutVerification?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        deleteUser?
      </code>
      
      : { <code>
        enabled?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        sendDeleteAccountVerification?
      </code>
      
      : (<code>
        data
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        beforeDelete?
      </code>
      
      : (<code>
        user
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        afterDelete?
      </code>
      
      : (<code>
        user
      </code>
      
      , <code>
        request?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >; <code>
        deleteTokenExpiresIn?
      </code>
      
      : <code>
        number
      </code>
      
      ; }; }; <code>
        rateLimit
      </code>
      
      : { <code>
        window?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        max?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        modelName?
      </code>
      
      : <code>
        "rateLimit"
      </code>
      
       | <code>
        LiteralString
      </code>
      
      ; <code>
        fields?
      </code>
      
      : <code>
        Partial
      </code>
      
      <<code>
        Record
      </code>
      
      <<code>
        "key"
      </code>
      
       | <code>
        "count"
      </code>
      
       | <code>
        "lastRequest"
      </code>
      
      , <code>
        string
      </code>
      
      >>; <code>
        customRules?
      </code>
      
      : { [<code>
        key
      </code>
      
      : <code>
        string
      </code>
      
      ]: | <code>
        false
      </code>
      
       | <code>
        BetterAuthRateLimitRule
      </code>
      
       | ((<code>
        request
      </code>
      
      , <code>
        currentRule
      </code>
      
      ) => <code>
        Awaitable
      </code>
      
      <... | ...>); }; <code>
        storage?
      </code>
      
      : <code>
        "memory"
      </code>
      
       | <code>
        "database"
      </code>
      
       | <code>
        "secondary-storage"
      </code>
      
      ; <code>
        customStorage?
      </code>
      
      : <code>
        BetterAuthRateLimitStorage
      </code>
      
      ; <code>
        enabled
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }; <code>
        hooks
      </code>
      
      : | { <code>
        before?
      </code>
      
      : <code>
        MiddlewareHandler
      </code>
      
      ; <code>
        after?
      </code>
      
      : <code>
        MiddlewareHandler
      </code>
      
      ; } | <code>
        undefined
      </code>
      
      ; <code>
        plugins
      </code>
      
      : [{ <code>
        id
      </code>
      
      : <code>
        "convex"
      </code>
      
      ; <code>
        version
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        init
      </code>
      
      : (<code>
        ctx
      </code>
      
      ) => <code>
        void
      </code>
      
      ; <code>
        hooks
      </code>
      
      : { <code>
        before
      </code>
      
      : ( | { <code>
        matcher
      </code>
      
      (<code>
        context
      </code>
      
      ): <code>
        boolean
      </code>
      
      ; <code>
        handler
      </code>
      
      : (<code>
        inputContext
      </code>
      
      ) => ...; } | { <code>
        matcher
      </code>
      
      : (<code>
        ctx
      </code>
      
      ) => ...; <code>
        handler
      </code>
      
      : (<code>
        inputContext
      </code>
      
      ) => ...; })<span>
        
      </span>
      
      ; <code>
        after
      </code>
      
      : { <code>
        matcher
      </code>
      
      : (<code>
        context
      </code>
      
      ) => <code>
        boolean
      </code>
      
      ; <code>
        handler
      </code>
      
      : <code>
        MiddlewareHandler
      </code>
      
      ; }<span>
        
      </span>
      
      ; }; <code>
        endpoints
      </code>
      
      : { <code>
        getOpenIdConfig
      </code>
      
      : <code>
        StrictEndpoint
      </code>
      
      <<code>
        "/convex/.well-known/openid-configuration"
      </code>
      
      , { <code>
        method
      </code>
      
      : <code>
        "GET"
      </code>
      
      ; <code>
        metadata
      </code>
      
      : { <code>
        isAction
      </code>
      
      : <code>
        false
      </code>
      
      ; }; }, <code>
        OIDCMetadata
      </code>
      
      >; <code>
        getJwks
      </code>
      
      : <code>
        StrictEndpoint
      </code>
      
      <<code>
        "/convex/jwks"
      </code>
      
      , { <code>
        method
      </code>
      
      : <code>
        "GET"
      </code>
      
      ; <code>
        metadata
      </code>
      
      : { <code>
        openapi
      </code>
      
      : { <code>
        description
      </code>
      
      : ...; <code>
        responses
      </code>
      
      : ...; }; }; }, <code>
        JSONWebKeySet
      </code>
      
      >; <code>
        getLatestJwks
      </code>
      
      : <code>
        StrictEndpoint
      </code>
      
      <<code>
        "/convex/latest-jwks"
      </code>
      
      , { <code>
        isAction
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        method
      </code>
      
      : <code>
        "POST"
      </code>
      
      ; <code>
        metadata
      </code>
      
      : { <code>
        SERVER_ONLY
      </code>
      
      : <code>
        true
      </code>
      
      ; <code>
        openapi
      </code>
      
      : { <code>
        description
      </code>
      
      : ...; }; }; }, <code>
        any
      </code>
      
      <span>
        
      </span>
      
      >; <code>
        rotateKeys
      </code>
      
      : <code>
        StrictEndpoint
      </code>
      
      <<code>
        "/convex/rotate-keys"
      </code>
      
      , { <code>
        isAction
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        method
      </code>
      
      : <code>
        "POST"
      </code>
      
      ; <code>
        metadata
      </code>
      
      : { <code>
        SERVER_ONLY
      </code>
      
      : <code>
        true
      </code>
      
      ; <code>
        openapi
      </code>
      
      : { <code>
        description
      </code>
      
      : ...; }; }; }, <code>
        any
      </code>
      
      <span>
        
      </span>
      
      >; <code>
        getToken
      </code>
      
      : <code>
        StrictEndpoint
      </code>
      
      <<code>
        "/convex/token"
      </code>
      
      , { <code>
        method
      </code>
      
      : <code>
        "GET"
      </code>
      
      ; <code>
        requireHeaders
      </code>
      
      : <code>
        true
      </code>
      
      ; <code>
        use
      </code>
      
      : ((<code>
        inputContext
      </code>
      
      ) => ...)<span>
        
      </span>
      
      ; <code>
        metadata
      </code>
      
      : { <code>
        openapi
      </code>
      
      : { <code>
        description
      </code>
      
      : ...; <code>
        responses
      </code>
      
      : ...; }; }; }, { <code>
        token
      </code>
      
      : <code>
        string
      </code>
      
      ; }>; }; <code>
        schema
      </code>
      
      : { <code>
        jwks
      </code>
      
      : { <code>
        fields
      </code>
      
      : { <code>
        publicKey
      </code>
      
      : { <code>
        type
      </code>
      
      : <code>
        "string"
      </code>
      
      ; <code>
        required
      </code>
      
      : <code>
        true
      </code>
      
      ; }; <code>
        privateKey
      </code>
      
      : { <code>
        type
      </code>
      
      : <code>
        "string"
      </code>
      
      ; <code>
        required
      </code>
      
      : <code>
        true
      </code>
      
      ; }; <code>
        createdAt
      </code>
      
      : { <code>
        type
      </code>
      
      : <code>
        "date"
      </code>
      
      ; <code>
        required
      </code>
      
      : <code>
        true
      </code>
      
      ; }; <code>
        expiresAt
      </code>
      
      : { <code>
        type
      </code>
      
      : <code>
        "date"
      </code>
      
      ; <code>
        required
      </code>
      
      : <code>
        false
      </code>
      
      ; }; }; }; <code>
        user
      </code>
      
      : { <code>
        fields
      </code>
      
      : { <code>
        userId
      </code>
      
      : { <code>
        type
      </code>
      
      : <code>
        "string"
      </code>
      
      ; <code>
        required
      </code>
      
      : <code>
        false
      </code>
      
      ; <code>
        input
      </code>
      
      : <code>
        false
      </code>
      
      ; }; }; }; }; }, ...(BetterAuthPlugin | { id: "email-otp"; version: string; init: any; endpoints: { sendVerificationOTP: StrictEndpoint<"/email-otp/send-verification-otp", { method: "POST"; use: (...)[]; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; createVerificationOTP: StrictEndpoint<string, { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, string>; getVerificationOTP: StrictEndpoint<string, { method: "GET"; query: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { otp: ... } | { otp: ... }>; checkVerificationOTP: StrictEndpoint<"/email-otp/check-verification-otp", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; verifyEmailOTP: StrictEndpoint<"/email-otp/verify-email", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { status: ...; token: ...; user: ... } | { status: ...; token: ...; user: ... }>; signInEmailOTP: StrictEndpoint<"/sign-in/email-otp", { method: "POST"; body: ZodIntersection<(...), (...)>; metadata: { openapi: ... } }, { token: string; user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... } }>; requestPasswordResetEmailOTP: StrictEndpoint<"/email-otp/request-password-reset", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; forgetPasswordEmailOTP: StrictEndpoint<"/forget-password/email-otp", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; resetPasswordEmailOTP: StrictEndpoint<"/email-otp/reset-password", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { success: boolean }>; requestEmailChangeEmailOTP: StrictEndpoint<"/email-otp/request-email-change", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; changeEmailEmailOTP: StrictEndpoint<"/email-otp/change-email", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }> }; hooks: { after: { matcher: any; handler: Middleware<(...), (...)> }[] }; rateLimit: ({ pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number } | { pathMatcher: any; window: number; max: number })[]; options: EmailOTPOptions; $ERROR_CODES: { OTP_EXPIRED: RawError<"OTP_EXPIRED">; INVALID_OTP: RawError<"INVALID_OTP">; TOO_MANY_ATTEMPTS: RawError<"TOO_MANY_ATTEMPTS"> } } | { id: "passkey"; version: string; endpoints: { generatePasskeyRegistrationOptions: StrictEndpoint<"/passkey/generate-register-options", { method: "GET"; use: (...)[]; query: ZodOptional<(...)>; metadata: { openapi: ... } }, PublicKeyCredentialCreationOptionsJSON>; generatePasskeyAuthenticationOptions: StrictEndpoint<"/passkey/generate-authenticate-options", { method: "GET"; metadata: { openapi: ... } }, PublicKeyCredentialRequestOptionsJSON>; verifyPasskeyRegistration: StrictEndpoint<"/passkey/verify-registration", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, Passkey>; verifyPasskeyAuthentication: StrictEndpoint<"/passkey/verify-authentication", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { session: { id: ...; createdAt: ...; updatedAt: ...; userId: ...; expiresAt: ...; token: ...; ipAddress?: ...; userAgent?: ... }; user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... } }>; listPasskeys: StrictEndpoint<"/passkey/list-user-passkeys", { method: "GET"; use: (...)[]; metadata: { openapi: ... } }, Passkey[]>; deletePasskey: StrictEndpoint<"/passkey/delete-passkey", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { status: boolean }>; updatePasskey: StrictEndpoint<"/passkey/update-passkey", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { passkey: Passkey }> }; schema: { passkey: { fields: { name: { type: ...; required: ... }; publicKey: { type: ...; required: ... }; userId: { type: ...; references: ...; required: ...; index: ... }; credentialID: { type: ...; required: ...; index: ... }; counter: { type: ...; required: ... }; deviceType: { type: ...; required: ... }; backedUp: { type: ...; required: ... }; transports: { type: ...; required: ... }; createdAt: { type: ...; required: ... }; aaguid: { type: ...; required: ... } } } }; $ERROR_CODES: { CHALLENGE_NOT_FOUND: RawError<"CHALLENGE_NOT_FOUND">; YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">; FAILED_TO_VERIFY_REGISTRATION: RawError<"FAILED_TO_VERIFY_REGISTRATION">; PASSKEY_NOT_FOUND: RawError<"PASSKEY_NOT_FOUND">; AUTHENTICATION_FAILED: RawError<"AUTHENTICATION_FAILED">; UNABLE_TO_CREATE_SESSION: RawError<"UNABLE_TO_CREATE_SESSION">; FAILED_TO_UPDATE_PASSKEY: RawError<"FAILED_TO_UPDATE_PASSKEY">; PREVIOUSLY_REGISTERED: RawError<"PREVIOUSLY_REGISTERED">; REGISTRATION_CANCELLED: RawError<"REGISTRATION_CANCELLED">; AUTH_CANCELLED: RawError<"AUTH_CANCELLED">; UNKNOWN_ERROR: RawError<"UNKNOWN_ERROR">; SESSION_REQUIRED: RawError<"SESSION_REQUIRED">; RESOLVE_USER_REQUIRED: RawError<"RESOLVE_USER_REQUIRED">; RESOLVED_USER_INVALID: RawError<"RESOLVED_USER_INVALID"> }; options: PasskeyOptions | undefined } | { id: "admin"; version: string; init: any; hooks: { after: { matcher: any; handler: Middleware<(...), (...)> }[] }; endpoints: { setRole: StrictEndpoint<"/admin/set-role", { method: "POST"; body: ZodObject<(...), (...)>; requireHeaders: true; use: (...)[]; metadata: { openapi: ...; $Infer: ... } }, { user: UserWithRole }>; getUser: StrictEndpoint<"/admin/get-user", { method: "GET"; query: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, UserWithRole>; createUser: StrictEndpoint<"/admin/create-user", { method: "POST"; body: ZodObject<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { user: UserWithRole }>; adminUpdateUser: StrictEndpoint<"/admin/update-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, UserWithRole>; listUsers: StrictEndpoint<"/admin/list-users", { method: "GET"; use: (...)[]; query: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { users: (...)[]; total: number }>; listUserSessions: StrictEndpoint<"/admin/list-user-sessions", { method: "POST"; use: (...)[]; body: ZodObject<(...), (...)>; metadata: { openapi: ... } }, { sessions: (...)[] }>; unbanUser: StrictEndpoint<"/admin/unban-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { user: UserWithRole }>; banUser: StrictEndpoint<"/admin/ban-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { user: UserWithRole }>; impersonateUser: StrictEndpoint<"/admin/impersonate-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { session: { id: ...; createdAt: ...; updatedAt: ...; userId: ...; expiresAt: ...; token: ...; ipAddress?: ...; userAgent?: ... }; user: UserWithRole }>; stopImpersonating: StrictEndpoint<"/admin/stop-impersonating", { method: "POST"; requireHeaders: true }, { session: (...) & (...); user: (...) & (...) }>; revokeUserSession: StrictEndpoint<"/admin/revoke-user-session", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; revokeUserSessions: StrictEndpoint<"/admin/revoke-user-sessions", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; removeUser: StrictEndpoint<"/admin/remove-user", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { success: boolean }>; setUserPassword: StrictEndpoint<"/admin/set-user-password", { method: "POST"; body: ZodObject<(...), (...)>; use: (...)[]; metadata: { openapi: ... } }, { status: boolean }>; userHasPermission: StrictEndpoint<"/admin/has-permission", { method: "POST"; body: ZodIntersection<(...), (...)>; metadata: { openapi: ...; $Infer: ... } }, { error: null; success: boolean }> }; $ERROR_CODES: { USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">; FAILED_TO_CREATE_USER: RawError<"FAILED_TO_CREATE_USER">; USER_ALREADY_EXISTS: RawError<"USER_ALREADY_EXISTS">; YOU_CANNOT_BAN_YOURSELF: RawError<"YOU_CANNOT_BAN_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">; YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">; YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">; YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">; YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">; YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">; BANNED_USER: RawError<"BANNED_USER">; YOU_ARE_NOT_ALLOWED_TO_GET_USER: RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">; NO_DATA_TO_UPDATE: RawError<"NO_DATA_TO_UPDATE">; YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">; YOU_CANNOT_REMOVE_YOURSELF: RawError<"YOU_CANNOT_REMOVE_YOURSELF">; YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">; YOU_CANNOT_IMPERSONATE_ADMINS: RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">; INVALID_ROLE_TYPE: RawError<"INVALID_ROLE_TYPE">; YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">; PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER"> }; schema: { user: { fields: { role: { type: ...; required: ...; input: ... }; banned: { type: ...; defaultValue: ...; required: ...; input: ... }; banReason: { type: ...; required: ...; input: ... }; banExpires: { type: ...; required: ...; input: ... } } }; session: { fields: { impersonatedBy: { type: ...; required: ...; input: ... } } } }; options: NoInfer<AdminOptions> } | DefaultOrganizationPlugin<{ allowUserToCreateOrganization?: boolean | ((user: (...) & (...)) => Awaitable<(...)>); organizationLimit?: number | ((user: (...) & (...)) => Awaitable<(...)>); creatorRole?: string; membershipLimit?: number | ((user: { id: ...; createdAt: ...; updatedAt: ...; email: ...; emailVerified: ...; name: ...; image?: ... }, organization: { id: ...; name: ...; slug: ...; logo?: ...; metadata?: ...; createdAt: ... }) => (...) | (...)); ac?: AccessControl; roles?: { [key: string]: (...) | (...) }; dynamicAccessControl?: { enabled?: (...) | (...) | (...); maximumRolesPerOrganization?: (...) | (...) | (...) }; teams?: { enabled: boolean; defaultTeam?: (...) | (...); maximumTeams?: (...) | (...) | (...); maximumMembersPerTeam?: (...) | (...) | (...); allowRemovingAllTeams?: (...) | (...) | (...) }; invitationExpiresIn?: number; invitationLimit?: number | ((data: { user: ...; organization: ...; member: ... }, ctx: AuthContext) => Awaitable<(...)>); cancelPendingInvitationsOnReInvite?: boolean; requireEmailVerificationOnInvitation?: boolean; sendInvitationEmail?: (data: { id: ...; role: ...; email: ...; organization: ...; invitation: ...; inviter: ... }, request?: (...) | (...)) => Promise<(...)>; schema?: { session?: (...) | (...); organization?: (...) | (...); member?: (...) | (...); invitation?: (...) | (...); team?: (...) | (...); teamMember?: (...) | (...); organizationRole?: (...) | (...) }; disableOrganizationDeletion?: boolean; organizationHooks?: { beforeCreateOrganization?: (...) | (...); afterCreateOrganization?: (...) | (...); beforeUpdateOrganization?: (...) | (...); afterUpdateOrganization?: (...) | (...); beforeDeleteOrganization?: (...) | (...); afterDeleteOrganization?: (...) | (...); beforeAddMember?: (...) | (...); afterAddMember?: (...) | (...); beforeRemoveMember?: (...) | (...); afterRemoveMember?: (...) | (...); beforeUpdateMemberRole?: (...) | (...); afterUpdateMemberRole?: (...) | (...); beforeCreateInvitation?: (...) | (...); afterCreateInvitation?: (...) | (...); beforeAcceptInvitation?: (...) | (...); afterAcceptInvitation?: (...) | (...); beforeRejectInvitation?: (...) | (...); afterRejectInvitation?: (...) | (...); beforeCancelInvitation?: (...) | (...); afterCancelInvitation?: (...) | (...); beforeCreateTeam?: (...) | (...); afterCreateTeam?: (...) | (...); beforeUpdateTeam?: (...) | (...); afterUpdateTeam?: (...) | (...); beforeDeleteTeam?: (...) | (...); afterDeleteTeam?: (...) | (...); beforeAddTeamMember?: (...) | (...); afterAddTeamMember?: (...) | (...); beforeRemoveTeamMember?: (...) | (...); afterRemoveTeamMember?: (...) | (...) } }>)[]]; }>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mcp
      </code>
    </td>
    
    <td>
      <a href="#mcpexchange">
        <code>
          McpExchange
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/client/index.ts" rel="nofollow">
        src/convex/client/index.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Example

```ts
import { setupAuth } from 'nuxt-backend/auth'
import { components } from './_generated/api'
import { query } from './_generated/server'
import { email } from './email'

export const { authComponent, createAuth, getAuthUser } = setupAuth(components, query, {
  email,
  canSignIn: async (ctx, { email }) => email.endsWith('@acme.com'),
})
```


## Sitemap

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