npm.io
2.22.7 • Published 4d ago

@medusajs/notification-local

Licence
MIT
Version
2.22.7
Deps
0
Size
11 kB
Vulns
0
Weekly
0
Stars
36.5K

Medusa logo

@medusajs/notification-local

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

Local Notification Module Provider for Medusa: simulates sending notifications by logging their recipient, channel, template, and data with the Medusa logger. Use it in development and tests, or to audit notifications without a real delivery service. It's registered by default for the feed channel and ships with @medusajs/medusa, registered through the @medusajs/medusa/notification-local path.

At a glance

Package @medusajs/notification-local
Type Module Provider (Notification Module)
Provider ID notification-local
Registered by default Yes, with id: "local" and channels: ["feed"]
Import from @medusajs/medusa/notification-local

Installation

No installation needed. The provider is a dependency of @medusajs/medusa and is registered by default.

Usage

Register it yourself to use it for other channels, such as email. Each channel can be handled by only one provider.

import { defineConfig } from "@medusajs/framework/utils"

module.exports = defineConfig({
  // ...
  modules: [
    {
      resolve: "@medusajs/medusa/notification",
      options: {
        providers: [
          {
            resolve: "@medusajs/medusa/notification-local",
            id: "local",
            options: {
              channels: ["email"],
            },
          },
        ],
      },
    },
  ],
})

Configuration

Option Type Description Default
channels string[] Read by the Notification Module. The channels this provider handles; it isn't used for other channels. []

Resources

Keywords