Web Push Notifications
  • Integration
    • My website already has a service worker
    • My website does not have a service worker
    • Salesforce Commerce Cloud
  • Defining Notifications
    • Image sizing
  • Dashboard
  • Settings
  • Troubleshooting
Powered by GitBook
On this page
  • Enable Service Worker
  • Make service worker accessible from the root
  1. Integration

Salesforce Commerce Cloud

PreviousMy website does not have a service workerNextDefining Notifications

Last updated 3 years ago

This guide is for SFCC users who do not already have a service worker running at the root of their site. If your site already has a service worker, please import our script by following the guide, Using an existing service worker.

Enable Service Worker

Navigate to the Fanplayr plugin configuration page and enable the service worker:

Make service worker accessible from the root

  1. Within SFCC, navigate to Business Manager / Merchant Tools / SEO / Aliases.

  2. Edit the alias config to add the following route, adjusting as necessary to match your hostname.

{
  "my-store.demandware.net" : [
    {
      "if-site-path": "/serviceWorker.js",
      "pipeline": "Fanplayr-ServiceWorker"
    }
  ]
}