npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rikology/adonisjs-notifications

v1.5.0

Published

Send notifications through multiple channels with Laravel-inspired ergonomics for AdonisJS v7

Readme

@rikology/adonisjs-notifications

Multi-channel notifications with Laravel-inspired ergonomics for AdonisJS v7

Send notifications through multiple channels using a clean, expressive syntax. Queue deliveries, persist notifications to a database inbox, fake them in tests, and build custom channels with minimal boilerplate.

Installation

npm i @rikology/adonisjs-notifications

Then configure the package:

node ace configure @rikology/adonisjs-notifications

This sets up the provider, copies the config file, registers the CLI commands, and optionally publishes the required migrations.

Quick start

Send your first notification in five steps:

1. Install the package

npm i @rikology/adonisjs-notifications

2. Create a notification

node ace make:notification OrderShipped

3. Define the notification

import { Notification, MailMessage } from '@rikology/adonisjs-notifications'
import Order from '#models/order'

export default class OrderShippedNotification extends Notification {
  public shouldQueue = false

  constructor(private order: Order) {
    super()
  }

  via(notifiable: unknown): string[] {
    return ['mail']
  }

  toMail(notifiable: unknown) {
    return MailMessage.create()
      .subject(`Order #${this.order.id} has shipped`)
      .line('Your order has been shipped and is on its way!')
      .action('Track your order', `/orders/${this.order.id}`)
  }
}

4. Add the mixin to your User model

import { withNotifications } from '@rikology/adonisjs-notifications'

export default class User extends compose(BaseModel, withNotifications()) {
  // ...
}

5. Send the notification

import notifications from '@rikology/adonisjs-notifications/services/main'
import OrderShippedNotification from '#notifications/order_shipped_notification'

await notifications.send(user, new OrderShippedNotification(order))
// or via the model
await user.notify(new OrderShippedNotification(order))

Table of contents

Guides

Examples

Feature highlights

  • Multi-channel delivery — Send through mail, database (inbox), log, or null channels from a single notification class.
  • Queue support — Queue any notification channel with shouldQueue = true, per-notification queue names, and per-channel delays. No delivery code needed.
  • Database inbox — Persist notifications and query them directly on the notifiable model with user.notifications() and user.unreadNotifications().
  • Test fakes — Swap the real manager for a fake that records every notification and exposes rich assertions. No network calls during tests.
  • Laravel-style API — Designed to feel familiar: via(), toMail(), shouldSend(), MailMessage.create(), .subject(), .line(), .action().
  • Routing — Declarative route resolution with fallback strategies, anonymous route notifications, and per-notification overrides.
  • Lifecycle events — Listen for notification:sending, notification:sent, notification:failed, notification:skipped, and notification:queued.
  • Delivery tracking — Track every delivery attempt, retry failed jobs, and prune old records with built-in CLI commands.
  • Custom channels — Register your own channels at runtime or via config with a single line.

Peer dependencies

The following are optional peer dependencies. Install only the ones you need:

  • @adonisjs/lucid — Required for the database channel and inbox features.
  • @adonisjs/mail — Required for the mail channel.
  • @adonisjs/queue — Required for queue-based delivery.

Requirements

  • Node.js >= 24
  • AdonisJS v7

License

MIT