Links

Web Push

1. Requirements

Sign up to FlareLane and create a project.

2. Start Setup

Click Channel > Web Push to start setup.

3. Input Website Details

Description
Website Name
Website name will be auto-filled when message title is left blank
Website URL
Input the exact website address for SDK integration. If the URL does not match, web push will not work.

The following URLs are also supported based on the URL you entered:
  • When "http" is entered, "https" is also supported
  • Supports mobile subdomains (m.example.com)

4. Create and Upload ServiceWorker

If there is no existing ServiceWorker file in use, create a new file named sw.js. If there is already a file in use, open it in an editor.
Add the following script to the ServiceWorker file.
sw.js
importScripts('https://cdn.flarelane.com/ServiceWorker.js');
Upload the ServiceWorker file at the root path of the website.
(ex. If the file sw.js is located in the 'example.com' domain, it should be accessible at example.com/sw.js)

5. Install SDK and Implement Initialization Code

You can check your project ID at FlareLane console's Project
Add the following script right before the </body> tag of your website.
<script src="https://cdn.flarelane.com/WebSDK.js" charset="UTF-8"></script>
<script>
FlareLane.initialize({
projectId: "PROJECT_ID",
// If there is a Service Worker with a different name
// serviceWorkerPath: '/otherServiceWorker.js'
});
</script>

6. Complete Setup

If everything has been set up correctly, a prompt asking for permission to subscribe will appear when the website is refreshed.
Then, you can proceed with the detailed setting such as the setting up an icon at FlareLane console's Channel > Web Push.

7. Advanced Settings

To use Journeys or Message Personalization, integrate custom data via SDK or API: