@1auth/notify

Base notification interface for sending events through configured channels.

Install

npm i @1auth/notify

Usage

import * as notify from '@1auth/notify'

notify.default({
  client: (message) => { /* handle notification */ }
})

API

trigger(id, sub, data, notifyOptions)

Emit a notification event.

ParameterTypeDescription
idstringTemplate identifier (e.g., email-verify)
substringSubject/user ID
dataobjectTemplate variables
notifyOptionsobjectDelivery options

The notifyOptions object can include:

  • messengers — Array of {id} or {type, value} targets
  • types — Array of messenger types to target

The notification service is responsible for rendering templates and delivering messages through the appropriate channel.