Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 383 Bytes

File metadata and controls

18 lines (12 loc) · 383 Bytes

Notifications

Wrapper for the Web Notifications API.

Usage

import {Notifications} from "./Notifications.js"

const notifications = new Notifications()
notifications.requestPermission()
notifications.show("Title", "Message body")

Methods

  • requestPermission() — request notification permission from the user
  • show(title, body) — display a notification