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

Version: nuxt-backend 0.6.x · Tab: Reference · Kind: reference · Status: stable

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

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

## Interfaces

### NotificationParty

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

Someone a notification names. `administrator`: unnamed, to the account they acted on, and to everyone for what they did while acting as an account. `app`: nobody signed in. `erased`: an account since erased.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="kind">
        
      </a>
      
       <code>
        kind
      </code>
    </td>
    
    <td>
      <code>
        "user"
      </code>
      
       | <code>
        "you"
      </code>
      
       | <code>
        "administrator"
      </code>
      
       | <code>
        "app"
      </code>
      
       | <code>
        "erased"
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationEntry

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

One notification as the inbox reads it: ids and values, never the words (they are labels).

#### 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">
        
      </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/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="type">
        
      </a>
      
       <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The event's type: a kind of the package's catalog, or one of your own under <code>
        app.
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="at">
        
      </a>
      
       <code>
        at
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      When it was recorded, epoch ms.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="readat">
        
      </a>
      
       <code>
        readAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      When it was read; <code>
        null
      </code>
      
       while unread.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="channels">
        
      </a>
      
       <code>
        channels
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      The channels it went out on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="actor">
        
      </a>
      
       <code>
        actor
      </code>
    </td>
    
    <td>
      <a href="#notificationparty">
        <code>
          NotificationParty
        </code>
      </a>
    </td>
    
    <td>
      Who did it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="workspace">
        
      </a>
      
       <code>
        workspace
      </code>
    </td>
    
    <td>
      | { <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; } | <code>
        null
      </code>
    </td>
    
    <td>
      The workspace it happened in, by its name now.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="entity">
        
      </a>
      
       <code>
        entity
      </code>
    </td>
    
    <td>
      <a href="#notificationentity">
        <code>
          NotificationEntity
        </code>
      </a>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      Whose plan, credits or gift a billing, gift or referral kind is about: <code>
        account
      </code>
      
       the reader's own (<code>
        billTo: 'user'
      </code>
      
      ), <code>
        workspace
      </code>
      
       the one <code>
        workspace
      </code>
      
       names. <code>
        null
      </code>
      
       for every other kind. The inbox words an <code>
        account
      </code>
      
       one with the kind's <code>
        titleYours
      </code>
      
       and <code>
        bodyYours
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="targetid">
        
      </a>
      
       <code>
        targetId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      The thing acted on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="link">
        
      </a>
      
       <code>
        link
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      Where it links, for a kind of your own (<code>
        notify
      </code>
      
      's <code>
        link
      </code>
      
      ); <code>
        null
      </code>
      
       for a package kind, which links to a ready-made page by its type.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="data">
        
      </a>
      
       <code>
        data
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
       | <code>
        boolean
      </code>
      
       | <code>
        string
      </code>
      
      <span>
        
      </span>
      
      >
    </td>
    
    <td>
      The kind's own fields.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationsPage

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

A page of notifications, newest first, as a paginated query answers.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="page">
        
      </a>
      
       <code>
        page
      </code>
    </td>
    
    <td>
      <a href="#notificationentry">
        <code>
          NotificationEntry
        </code>
      </a>
      
      <span>
        
      </span>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="isdone">
        
      </a>
      
       <code>
        isDone
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="continuecursor">
        
      </a>
      
       <code>
        continueCursor
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="pagestatus">
        
      </a>
      
       <code>
        pageStatus?
      </code>
    </td>
    
    <td>
      <code>
        "SplitRecommended"
      </code>
      
       | <code>
        "SplitRequired"
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="splitcursor">
        
      </a>
      
       <code>
        splitCursor?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### UnreadCount

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

The unread count: exact up to 99, then `more`.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="count">
        
      </a>
      
       <code>
        count
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="more">
        
      </a>
      
       <code>
        more
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### MarkedRead

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

What marking read answers: how many changed, and whether more unread ones remain (mark all works in batches).

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="marked">
        
      </a>
      
       <code>
        marked
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="done">
        
      </a>
      
       <code>
        done
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationKindChoice

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

One kind of notification on the profile: each channel it allows, on or off for the person.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="type-1">
        
      </a>
      
       <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The kind: an event type of the package's catalog, or one of your own under <code>
        app.
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="channels-1">
        
      </a>
      
       <code>
        channels
      </code>
    </td>
    
    <td>
      { <code>
        channel
      </code>
      
      : <a href="#notificationchannel">
        <code>
          NotificationChannel
        </code>
      </a>
      
      ; <code>
        enabled
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }<span>
        
      </span>
    </td>
    
    <td>
      The channels the kind allows, in order, each with the person's choice (on until they turn it off).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### PushConfig

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

What `usePushSubscription` needs from the deployment: the public key a device subscribes with, `null` while push is off.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="publickey">
        
      </a>
      
       <code>
        publicKey
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationsApi

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

The reads and writes `backend/notifications.ts` re-exports, behind `useNotifications` and `<NotificationInbox>`.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="listnotifications">
        
      </a>
      
       <code>
        listNotifications
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        paginationOpts
      </code>
      
      : { <code>
        id?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        endCursor?
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        maximumRowsRead?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        maximumBytesRead?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        numItems
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        cursor
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; }; }, <code>
        Promise
      </code>
      
      <<a href="#notificationspage">
        <code>
          NotificationsPage
        </code>
      </a>
      
      >>
    </td>
    
    <td>
      The caller's notifications, newest first, a page at a time: a paginated query. Refused for a caller who has none to read: signed out (<code>
        unauthenticated
      </code>
      
      ), or an administrator acting as the account (<code>
        forbidden
      </code>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="getunreadcount">
        
      </a>
      
       <code>
        getUnreadCount
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        never
      </code>
      
      >, <code>
        Promise
      </code>
      
      <<a href="#unreadcount">
        <code>
          UnreadCount
        </code>
      </a>
      
      >>
    </td>
    
    <td>
      How many the caller has not read.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="marknotificationsread">
        
      </a>
      
       <code>
        markNotificationsRead
      </code>
    </td>
    
    <td>
      <code>
        RegisteredMutation
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        ids?
      </code>
      
      : <code>
        string
      </code>
      
      <span>
        
      </span>
      
      ; <code>
        all?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<a href="#markedread">
        <code>
          MarkedRead
        </code>
      </a>
      
      >>
    </td>
    
    <td>
      Mark the caller's notifications read: the <code>
        ids
      </code>
      
       named, or <code>
        all
      </code>
      
      . Another account's id changes nothing.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="getnotificationchannels">
        
      </a>
      
       <code>
        getNotificationChannels
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        never
      </code>
      
      >, <code>
        Promise
      </code>
      
      <<a href="#notificationkindchoice">
        <code>
          NotificationKindChoice
        </code>
      </a>
      
      <span>
        
      </span>
      
       | <code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      The caller's channels, kind by kind: every kind that notifies them, and each channel it allows, on or off. <code>
        null
      </code>
      
       signed out.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="setnotificationchannel">
        
      </a>
      
       <code>
        setNotificationChannel
      </code>
    </td>
    
    <td>
      <code>
        RegisteredMutation
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        type
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        channel
      </code>
      
      : <a href="#notificationchannel">
        <code>
          NotificationChannel
        </code>
      </a>
      
      ; <code>
        enabled
      </code>
      
      : <code>
        boolean
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      Turn one channel of one kind on or off for the caller. Refused for a channel the kind does not allow (<code>
        invalid_input
      </code>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="getpushconfig">
        
      </a>
      
       <code>
        getPushConfig
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      , <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        never
      </code>
      
      >, <code>
        Promise
      </code>
      
      <<a href="#pushconfig">
        <code>
          PushConfig
        </code>
      </a>
      
      >>
    </td>
    
    <td>
      The public key a device subscribes to web push with: <code>
        publicKey
      </code>
      
       is <code>
        null
      </code>
      
       until <code>
        PUSH_PUBLIC_KEY
      </code>
      
       and <code>
        PUSH_PRIVATE_KEY
      </code>
      
       are set.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subscribepush">
        
      </a>
      
       <code>
        subscribePush
      </code>
    </td>
    
    <td>
      <code>
        RegisteredMutation
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        endpoint
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        p256dh
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        auth
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      Keep this device for the caller's push notifications: the browser's subscription, as <code>
        PushSubscription.toJSON()
      </code>
      
       gives its endpoint and keys.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="unsubscribepush">
        
      </a>
      
       <code>
        unsubscribePush
      </code>
    </td>
    
    <td>
      <code>
        RegisteredMutation
      </code>
      
      <<code>
        "public"
      </code>
      
      , { <code>
        endpoint
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      Stop push notifications on this device, by its endpoint.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="delivernotification">
        
      </a>
      
       <code>
        deliverNotification
      </code>
    </td>
    
    <td>
      <code>
        RegisteredAction
      </code>
      
      <<code>
        "internal"
      </code>
      
      , { <code>
        attempt?
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        deviceId?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        link
      </code>
      
      : <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      ; <code>
        event
      </code>
      
      : { <code>
        data?
      </code>
      
      : <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
       | <code>
        boolean
      </code>
      
       | <code>
        string
      </code>
      
      <span>
        
      </span>
      
      >; <code>
        impersonated?
      </code>
      
      : <code>
        boolean
      </code>
      
      ; <code>
        actorId?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        entityId?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        targetId?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        type
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        at
      </code>
      
      : <code>
        number
      </code>
      
      ; }; <code>
        userId
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        channel
      </code>
      
      : <code>
        "push"
      </code>
      
       | <code>
        "email"
      </code>
      
      ; }, <code>
        Promise
      </code>
      
      <<code>
        null
      </code>
      
      >>
    </td>
    
    <td>
      Internal: words, renders and sends one notification by email or push, scheduled by the transaction that recorded its event. Re-export it under this name: the backend schedules it by name.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### Notifications

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

What the inbox needs of the app's `setupAudit`: the plan for an event of the app's own.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="plan">
        
      </a>
      
       <code>
        plan
      </code>
    </td>
    
    <td>
      (<code>
        event
      </code>
      
      ) => <a href="#notificationplan">
        <code>
          NotificationPlan
        </code>
      </a>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      What an event of your own becomes, by <code>
        notify
      </code>
      
      : the channels it may use and where it links. <code>
        setupAudit({ notifications })
      </code>
      
       asks it as each event is recorded; <code>
        null
      </code>
      
       for an event <code>
        notify
      </code>
      
       does not name.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="deliver">
        
      </a>
      
       <code>
        deliver
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        undefined
      </code>
      
      >
    </td>
    
    <td>
      The handle the component schedules a notification's email and push through (<code>
        deliverNotification
      </code>
      
      ); <code>
        undefined
      </code>
      
       without an <code>
        email
      </code>
      
       instance, when only the inbox delivers. <code>
        setupAudit
      </code>
      
       passes it on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="forget">
        
      </a>
      
       <code>
        forget
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        notifications
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<a href="#forgottennotifications">
        <code>
          ForgottenNotifications
        </code>
      </a>
      
      >
    </td>
    
    <td>
      Delete the notifications of one kind of your own about one target, every recipient's, read or not, in your mutation's transaction: call it where you delete the thing they point at, so no inbox keeps a link to a page that is gone. <code>
        kind
      </code>
      
       is a type <code>
        notify
      </code>
      
       names, <code>
        target
      </code>
      
       the <code>
        targetId
      </code>
      
       the events were recorded with. The events stay on the audit trail. One call deletes up to 200: <code>
        done
      </code>
      
       is <code>
        false
      </code>
      
       while more are left, so call again, or from a scheduled function, until it is <code>
        true
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="api">
        
      </a>
      
       <code>
        api
      </code>
    </td>
    
    <td>
      <a href="#notificationsapi">
        <code>
          NotificationsApi
        </code>
      </a>
    </td>
    
    <td>
      The public reads and writes <code>
        backend/notifications.ts
      </code>
      
       re-exports.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### ForgottenNotifications

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

What `forget` answers: how many notifications went, and whether none of that kind about that target are left.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="deleted">
        
      </a>
      
       <code>
        deleted
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="done-1">
        
      </a>
      
       <code>
        done
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationsEmail

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

What the notifications need of `setupEmail`'s instance: the layout and words, the templates, and the sending rules.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="compose">
        
      </a>
      
       <code>
        compose
      </code>
    </td>
    
    <td>
      <<code>
        Message
      </code>
      
      >(<code>
        build
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        Message
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="render">
        
      </a>
      
       <code>
        render
      </code>
    </td>
    
    <td>
      <<code>
        Name
      </code>
      
      >(<code>
        name
      </code>
      
      , <code>
        data
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<a href="https://nuxt-backend.dev/docs/reference/api/email#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      Render one of the package's emails, the app's override in effect: a notification's email is the <code>
        notification
      </code>
      
       template.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="send">
        
      </a>
      
       <code>
        send
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        message
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      The transactional send, under no sending rule: a transactional kind's email goes through it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### SetupNotificationsOptions

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

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="notify">
        
      </a>
      
       <code>
        notify?
      </code>
    </td>
    
    <td>
      <code>
        Readonly
      </code>
      
      <<code>
        Record
      </code>
      
      <<code>
        `app.${string}`
      </code>
      
      , <a href="#notifykind">
        <code>
          NotifyKind
        </code>
      </a>
      
      >>
    </td>
    
    <td>
      What each event of your own (a type under <code>
        app.
      </code>
      
      ) becomes: the channels it may use and where it links. A type without an entry stays a row on the activity trail. <strong>
        Guarantee
      </strong>
      
       - Runs: <code>
        link
      </code>
      
      , in the mutation or action that records the event (<code>
        audit.recordBackendEvent
      </code>
      
      ), before its row is written - Delivery: once per event recorded; a notification is delivered in the transaction that records the event, and rolls back with it - Order: before the event is written, and before <code>
        onEvent
      </code>
      
       is scheduled - When it throws: the throw is logged as <code>
        notifications.deliver_failed
      </code>
      
       and the notification goes out without a link; the event is recorded either way - Idempotency: a read only: it can run again for a retried mutation
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="email">
        
      </a>
      
       <code>
        email?
      </code>
    </td>
    
    <td>
      <a href="#notificationsemail">
        <code>
          NotificationsEmail
        </code>
      </a>
    </td>
    
    <td>
      The email instance (<code>
        setupEmail
      </code>
      
      ), which email and push notifications are worded and rendered with: your messages, your brand and layout, and the weekly cap and quiet hours, which a transactional kind skips. Without it, notifications reach the inbox alone. Re-export <code>
        deliverNotification
      </code>
      
       with it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="paths">
        
      </a>
      
       <code>
        paths?
      </code>
    </td>
    
    <td>
      <code>
        Partial
      </code>
      
      <<a href="https://nuxt-backend.dev/docs/reference/api/auth#backendpaths">
        <code>
          BackendPaths
        </code>
      </a>
      
      >
    </td>
    
    <td>
      The paths the Nuxt module writes to <code>
        paths.generated.ts
      </code>
      
      : a package kind's email links to its ready-made page there.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="kinds">
        
      </a>
      
       <code>
        kinds?
      </code>
    </td>
    
    <td>
      readonly ( | <code>
        "email.bounced"
      </code>
      
       | <code>
        "auth.passkey_added"
      </code>
      
       | <code>
        "auth.passkey_removed"
      </code>
      
       | <code>
        "auth.passkey_only_changed"
      </code>
      
       | <code>
        "auth.email_changed"
      </code>
      
       | <code>
        "auth.new_device"
      </code>
      
       | <code>
        "workspace.invitation_accepted"
      </code>
      
       | <code>
        "workspace.member_removed"
      </code>
      
       | <code>
        "workspace.member_role_changed"
      </code>
      
       | <code>
        "admin.role_changed"
      </code>
      
       | <code>
        "billing.plan_changed"
      </code>
      
       | <code>
        "billing.subscription_created"
      </code>
      
       | <code>
        "billing.subscription_canceled"
      </code>
      
       | <code>
        "billing.subscription_revoked"
      </code>
      
       | <code>
        "billing.subscription_past_due"
      </code>
      
       | <code>
        "billing.order_paid"
      </code>
      
       | <code>
        "billing.order_refunded"
      </code>
      
       | <code>
        "billing.credits_low"
      </code>
      
       | <code>
        "billing.save_offer_accepted"
      </code>
      
       | <code>
        "billing.contract_withdrawn"
      </code>
      
       | <code>
        "billing.trial_pass_started"
      </code>
      
       | <code>
        "billing.credits_exhausted"
      </code>
      
       | <code>
        "gift.purchased"
      </code>
      
       | <code>
        "gift.claimed"
      </code>
      
       | <code>
        "gift.pass_started"
      </code>
      
       | <code>
        "gift.pass_ending"
      </code>
      
       | <code>
        "gift.pass_ended"
      </code>
      
       | <code>
        "gift.refunded"
      </code>
      
       | <code>
        "referral.claimed"
      </code>
      
       | <code>
        "referral.rewarded"
      </code>
      
      )<span>
        
      </span>
    </td>
    
    <td>
      The package's kinds your app sends, for the channel list (<code>
        getNotificationChannels
      </code>
      
      , <code>
        useEmailPreferences().channels
      </code>
      
      ): only these appear there, with your own kinds of <code>
        notify
      </code>
      
      , and only these take a choice (<code>
        setNotificationChannel
      </code>
      
      ). An app that never shares a workspace leaves out the <code>
        workspace.
      </code>
      
       kinds. Left out, every kind appears but those of a billing feature the deployment has never used: gifts, plan passes, reverse trials and referrals. The list shapes the choices only: a kind it leaves out still reaches the inbox if it happens.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationsComponents

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

The `backend` component as the inbox reads it.

#### 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>
        unknown
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/notifications.ts" rel="nofollow">
        src/convex/integrations/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationKind

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

What one kind of the package's catalog does as a notification.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="audience">
        
      </a>
      
       <code>
        audience
      </code>
    </td>
    
    <td>
      <a href="#notificationaudience">
        <code>
          NotificationAudience
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="page-1">
        
      </a>
      
       <code>
        page
      </code>
    </td>
    
    <td>
      <a href="#notificationdestination">
        <code>
          NotificationDestination
        </code>
      </a>
    </td>
    
    <td>
      Where it links: the page the person manages what the event is about on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="skipself">
        
      </a>
      
       <code>
        skipSelf?
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      Nobody hears of what they did themselves (a role they changed, a plan they switched).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="transactional">
        
      </a>
      
       <code>
        transactional?
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      News about the account's own safety or money: its email and push skip the weekly cap and the quiet hours (<a href="#transactional-1">
        NotifyKind.transactional
      </a>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="feature">
        
      </a>
      
       <code>
        feature?
      </code>
    </td>
    
    <td>
      <a href="#notificationfeature">
        <code>
          NotificationFeature
        </code>
      </a>
    </td>
    
    <td>
      The billing feature that records it: the channel list leaves the kind out while the deployment has never used it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotifyEvent

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

An event as a `notify` entry's `link` reads it: the row as recorded, before it has an id.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="type-2">
        
      </a>
      
       <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The event's type, under <code>
        app.
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="actorid">
        
      </a>
      
       <code>
        actorId?
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Who acted; absent for the app itself.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="impersonatorid">
        
      </a>
      
       <code>
        impersonatorId?
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The administrator behind an impersonated session.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subjectid">
        
      </a>
      
       <code>
        subjectId?
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The account it is about, who is notified.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="entityid">
        
      </a>
      
       <code>
        entityId?
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The workspace it happened in.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="targetid-1">
        
      </a>
      
       <code>
        targetId?
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The thing acted on.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="data-1">
        
      </a>
      
       <code>
        data?
      </code>
    </td>
    
    <td>
      <code>
        readonly
      </code>
    </td>
    
    <td>
      <code>
        Readonly
      </code>
      
      <<code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
       | <code>
        boolean
      </code>
      
       | <code>
        string
      </code>
      
      <span>
        
      </span>
      
      >>
    </td>
    
    <td>
      The event's own flat values.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotifyKind

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

What one event of an app's own becomes.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="channels-2">
        
      </a>
      
       <code>
        channels
      </code>
    </td>
    
    <td>
      readonly <a href="#notificationchannel">
        <code>
          NotificationChannel
        </code>
      </a>
      
      <span>
        
      </span>
    </td>
    
    <td>
      The channels it may use: <code>
        app
      </code>
      
       the inbox, <code>
        email
      </code>
      
       and <code>
        push
      </code>
      
       where the kind allows them. Narrowed by the channel matrix and by each person's choices.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="link-1">
        
      </a>
      
       <code>
        link?
      </code>
    </td>
    
    <td>
      (<code>
        event
      </code>
      
      ) => <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
       | <code>
        undefined
      </code>
    </td>
    
    <td>
      Where the notification links, from the event; a path of the app. Left out, it links nowhere.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="transactional-1">
        
      </a>
      
       <code>
        transactional?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      News the person is waiting for (a print they ordered is ready, a job of theirs failed): its email and push skip the weekly cap and the quiet hours, and its email does not count toward the cap, as a transactional email does not. The person's choice of channels still holds, and so does the email provider's suppression list. Leave it off for anything a person could read tomorrow.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### NotificationPlan

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

What the component is told to do with an event of an app's own.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="channels-3">
        
      </a>
      
       <code>
        channels
      </code>
    </td>
    
    <td>
      <a href="#notificationchannel">
        <code>
          NotificationChannel
        </code>
      </a>
      
      <span>
        
      </span>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="link-2">
        
      </a>
      
       <code>
        link?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### Delivery

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

One notification's delivery: who it is for, the event behind it and where it links.

#### Properties

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

<tbody>
  <tr>
    <td>
      <a id="userid">
        
      </a>
      
       <code>
        userId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="event">
        
      </a>
      
       <code>
        event
      </code>
    </td>
    
    <td>
      <a href="#notifyevent">
        <code>
          NotifyEvent
        </code>
      </a>
      
       & { <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        at
      </code>
      
      : <code>
        number
      </code>
      
      ; }
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="link-3">
        
      </a>
      
       <code>
        link
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/notifications.ts" rel="nofollow">
        src/convex/notifications.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### ChannelHandler

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

What a channel does to deliver one notification: the inbox writes its row
in the transaction that recorded the event, and email and push, once
they exist, enqueue their send there. It resolves `true` when the
notification was delivered (or enqueued), and never throws what would
roll the event back: the caller logs a failure and goes on.

#### Type Parameters

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

<tbody>
  <tr>
    <td>
      <a id="type-parameter-ctx-1">
        
      </a>
      
       <code>
        Ctx
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Methods

##### deliver()

```ts
deliver(ctx, delivery): Promise<boolean>;
```

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

###### Parameters

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

<tbody>
  <tr>
    <td>
      <code>
        ctx
      </code>
    </td>
    
    <td>
      <code>
        Ctx
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        delivery
      </code>
    </td>
    
    <td>
      <a href="#delivery">
        <code>
          Delivery
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

###### Returns

`Promise`<`boolean`>

## Type Aliases

### ScheduledDelivery

```ts
type ScheduledDelivery = typeof vScheduledDelivery.type;
```

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

One notification's email or push, as the component hands it to `deliverNotification`.

---

### NotificationsWriteCtx

```ts
type NotificationsWriteCtx = Pick<GenericMutationCtx<GenericDataModel>, "runMutation">;
```

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

Where `forget` runs: a mutation or an action of yours.

---

### NotificationChannel

```ts
type NotificationChannel = "app" | "email" | "push";
```

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

The channels a notification may take. `app` is the inbox; `email` and
`push` arrive with the preferences, behind [ChannelGate](#channelgate) and
[ChannelHandler](#channelhandler).

---

### NotificationAudience

```ts
type NotificationAudience = "subject" | "inviter" | "entity";
```

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

Who a kind notifies:

- `subject`: the account the event is about;
- `inviter`: whoever sent the invitation the event's `targetId` names, while
they are still a member, else the owners and admins of the workspace it joined;
- `entity`: the owners and admins of the workspace the event names
(`entityId`), else the account it is about. A billing entity is a
workspace, or an account billed on its own.

---

### NotificationDestination

```ts
type NotificationDestination = "profile" | "security" | "settings";
```

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

The ready-made page a notification links to, resolved by `pages.<key>` in the app's config.

---

### NotificationFeature

```ts
type NotificationFeature = "gifts" | "passes" | "trialPasses" | "referrals";
```

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

The billing feature a kind comes from, which an app may never use:

- `gifts`: a gift someone bought (a credit pack, or a plan as a pass);
- `passes`: a plan pass, gifted, a reverse trial's or a referral reward's;
- `trialPasses`: a reverse trial (a catalog plan's `trial: { pass: true }`);
- `referrals`: the referral program (`setupReferrals`).

---

### NotificationType

```ts
type NotificationType = keyof typeof NOTIFICATION_KINDS;
```

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

A kind of the package's catalog that notifies, by its event type (`billing.order_paid`).

---

### NotificationEntity

```ts
type NotificationEntity = "account" | "workspace";
```

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

Whose plan, credits or gift a billing kind is about: `account` the
reader's own (`billTo: 'user'`, where the person is the billing entity),
`workspace` one they manage.

---

### NotifyOptions

```ts
type NotifyOptions = Readonly<Record<`app.${string}`, NotifyKind>>;
```

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

The events of an app's own that notify: each type under `app.`, with what it becomes.

---

### ChannelGate

```ts
type ChannelGate<Ctx> = (ctx, userId, type, channel) => Promise<boolean>;
```

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

The person's own choices and limits for one channel of one kind: `false`
skips it. Notifications ships the answer yes; the preferences replace it
with each person's channel choices, the weekly cap and the quiet hours.
The inbox never waits for a cap or quiet hours: only an explicit choice
turns it off.

#### Type Parameters

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

<tbody>
  <tr>
    <td>
      <a id="type-parameter-ctx">
        
      </a>
      
       <code>
        Ctx
      </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>
        Ctx
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        userId
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        channel
      </code>
    </td>
    
    <td>
      <a href="#notificationchannel">
        <code>
          NotificationChannel
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`Promise`<`boolean`>

## Functions

### setupNotifications()

```ts
function setupNotifications(components, options?): Notifications;
```

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

The in-app inbox: what the backend recorded about a person, live, with
the unread count and marking read, and the `notify` option that turns
your own events into notifications.

Every event of the package that concerns a person (a role, a passkey, an
invitation, a payment, a gift, a bounce) reaches the inbox with nothing
set up. Your own kinds join through `notify`, and pass the instance to
`setupAudit({ notifications })` so the events you record reach it.

#### Parameters

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

<tbody>
  <tr>
    <td>
      <code>
        components
      </code>
    </td>
    
    <td>
      <a href="#notificationscomponents">
        <code>
          NotificationsComponents
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      <a href="#setupnotificationsoptions">
        <code>
          SetupNotificationsOptions
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

[`Notifications`](#notifications)

#### Example

```ts [backend/notifications.ts]
import { setupNotifications } from 'nuxt-backend/notifications'
import { components } from './_generated/api'

export const notifications = setupNotifications(components, {
  notify: { 'app.strip_ready': { channels: ['app'], link: event => `/strips/${event.targetId}` } },
})

export const { listNotifications, getUnreadCount, markNotificationsRead } = notifications.api
```


## Sitemap

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