Skip to content

basalt / notifications/src / defineNotification

Function: defineNotification() ​

> defineNotification<T>(definition): NotificationDefinition<T>

Defined in: notifications/src/definition.ts:51

export const InvoicePaid = defineNotification({ name: 'invoice.paid', schema: z.object({ number: z.string() }), channels: ['mail', 'inApp'], via: { mail: ({ number }) => ({ subject: Invoice ${number} paid, text: '…' }), inApp: ({ number }) => ({ title: 'Invoice paid', body: #${number} confirmed }), }, })

Type Parameters ​

T ​

T = void

Parameters ​

definition ​

NotificationDefinition<T>

Returns ​

NotificationDefinition<T>

Released under the MIT License.