Skip to content

Notifications

Available since: 0.55.0

Install, configure and send notifications to the Brezel Notification Center and over Web Push.

Notification Center

The following components are necessary to make notifications work:

  • Brotcast
  • Web Push (for Browser notifications, optional)

Installing Brotcast

Consult the corresponding repository.

Installing Webpush

This should happen automatically when initializing Brezel.

The only step involves setting up the VAPID keys (VAPID_PRIVATE_KEY and VAPID_PUBLIC_KEY). Run

Terminal window
php bakery init

or, if you use the api repository directly:

Terminal window
php artisan webpush:vapid

Sending notifications

Attributes of a Notification

  • id (string): ordered UUID
  • title (string): The notification’s title
  • message (string): The notification’s body
  • type (string): One of info, warning, error, progress, or a custom value.
  • icon (string): Image URL
  • image (string): Image URL
  • actions (list<dict>): Array of action dictionaries, rendered as action buttons.
    • action (string): Action identifier
    • title (string): Action title
    • icon (string): Action icon URL
  • data (dict): Custom data, as key-value pairs
  • entity (Entity): Entity appendix
  • worfklow (Workflow): Originator workflow of the notification