Setup

To use the Notifications API, install the @wix/notifications package using npm or Yarn:

Copy
1
npm install @wix/notifications

or

Copy
1
yarn add @wix/notifications

Then import { notifications } from @wix/notifications:

Copy
1
import { notifications } from '@wix/notifications'
Was this helpful?
Yes
No

notify( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Sends a notification.

The notify() function sends a notification to the specified recipients on the specified channels.

List the the channels for the notification in the channels parameter .

List the recipients for the notification in the toContacts, toSiteContributors, and toTopicsSubscribers parameters.

Copy
function notify(body: string, channels: Array<Channel>, options: NotifyOptions): Promise<void>
Method Parameters
bodystringRequired

The body of the notification.

Max: 512 characters


channelsArray<Channel>Required
4 enum supported values:
BrowserDashboardMobileUndefined

The channels to send the notification on. One or more of:

  • "Mobile": Sends the notification to the Wix App.
  • "Dashboard": Sends the notification to the contributor's Wix Dashboard.
  • "Browser": Sends the notification to the contributor's browser.

optionsNotifyOptions

Notification options.

Was this helpful?
Yes
No