JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29332
  • Score
    100M100P100Q158206F
  • License (MIT-0 OR Apache-2.0)

MetaMask example snap demonstrating the use of `snap_notify`

Package Exports

  • @metamask/notification-example-snap
  • @metamask/notification-example-snap/dist/bundle.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@metamask/notification-example-snap) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@metamask/notifications-example-snap

This snap demonstrates how to use snap_notify to send in-app and desktop notifications to the user.

Snap manifest

Note: Using snap_notify requires the snap_notify permissions. Refer to the documentation for more information.

Along with other permissions, the manifest of this snap includes the snap_notify permission:

{
  "initialPermissions": {
    "snap_notify": {}
  }
}

This permission does not require any additional configuration.

Snap usage

This snap exposes an onRpcRequest handler, which supports the following JSON-RPC methods:

  • inApp - Send an in-app notification to the user.
  • native - Send a desktop notification to the user.

For more information, you can refer to the end-to-end tests.