@metamask/notification-services-controller
TypeScript icon, indicating that this package has built-in type declarations

16.0.0 • Public • Published

@metamask/notification-services-controller

Manages the notification and push notification services used in MetaMask. This includes:

  • Wallet Notifications
  • Feature Announcements
  • Snap Notifications

Installation

yarn add @metamask/notification-services-controller

or

npm install @metamask/notification-services-controller

Usage

This package uses subpath exports, which helps to minimize the amount of code you need to import. It also helps to keep specific modules isolated and can be used to import specific code (e.g., mocks or platform-specific code). You can see all the exports in the package.json, but here are a few examples:

Importing specific controllers/modules:

// Import the NotificationServicesController and its associated types/utilities.
import { ... } from '@metamask/notification-services-controller/notification-services'

// Import the NotificationServicesPushController and its associated types/utilities.
import { ... } from '@metamask/notification-services-controller/push-services'

Importing mock creation functions:

// Import and use mock creation functions (designed to mirror the actual types).
// Useful for testing or Storybook development.
import { ... } from '@metamask/notification-services-controller/notification-services/mocks'
import { ... } from '@metamask/notification-services-controller/push-services/mocks'

Importing platform specific code:

// Some controllers provide interfaces for injecting platform-specific code, tailored to different clients (e.g., web or mobile).
import { ... } from '@metamask/notification-services-controller/push-services/web'

Contributing

This package is part of a monorepo. Instructions for contributing can be found in the monorepo README.

Readme

Keywords

Package Sidebar

Install

npm i @metamask/notification-services-controller

Weekly Downloads

24,187

Version

16.0.0

License

MIT

Unpacked Size

1.22 MB

Total Files

426

Last publish

Collaborators

  • danfinlay
  • kumavis
  • mcmire
  • rekmarks
  • metamaskbot
  • gudahtt
  • nicholasellul
  • sethkfman
  • naugtur