Web SDK Setup
Last updated
Last updated
Sign up to FlareLane and create a project.
Click Channel > Web Push to start setup.
Website Name
Website name will be auto-filled when message title is left blank
Website URL
URL must be started with "https://"
Download sw.js file and upload it to the root path of your website. (ex. If the file sw.js is located in the 'example.com' domain, it should be accessible at example.com/sw.js)
If you upload it correctly, you should be able to access it externally like this:
https://gp.flarelane.com/sw.js
You can check your project ID at FlareLane console's Project
Add the following script right before the </body> tag of your website.
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.
FlareLane's device is 'anonymous' and you can match the device with your user based on the unique user ID that identifies your user.
Setting up User ID has many benefits. You can distinguish whether a user has signed-up, and push notifications can be sent based on the User ID.
Usually, when a user sign-up or log-in, you should execute setUserId
.
To use Journeys or Message Personalization, integrate custom data via SDK or API: