Documentation
Website
  • Getting Started
  • Customer Journey
    • Creating a Customer Journey
    • Understanding the Journey
    • Performance Dashboard
    • Pre-built Templates
  • Cross-Channel Messages
    • Mobile Push
    • Web Push
    • In-App Message
    • SMS/LMS
    • Webhook
  • Data Integration
    • User ID
    • Events
    • Tags
    • Integrating Amplitude
    • Integrating Mixpanel
  • Audience
    • Segments
    • Device Management
  • Engagement Tools
    • Message Personalization
    • Template
  • Analytics & Insights
    • Dashboard
    • Real-time Analytics
  • Guide for Developers
    • Mobile SDK Setup
      • Android SDK Setup
      • iOS SDK Setup
      • React Native SDK Setup
      • Flutter SDK Setup
      • Additional Setup
        • Android: FCM Setup (v1)
        • Android: Notification Icons
        • iOS: APNS Setup
        • iOS: Disable Swizzling
    • Web SDK Setup
    • REST API Reference
    • Mobile SDK Reference
    • Web SDK Reference
Powered by GitBook
On this page
  • 1. Requirements
  • 2. Start Setup
  • 3. Input Website Details
  • 4. Upload sw.js
  • 5. SDK Setup
  • 6. Test
  • 7. Identify your user
  • 8. Additional Setup
  1. Guide for Developers

Web SDK Setup

PreviousiOS: Disable SwizzlingNextMobile SDK Reference

Last updated 2 months ago

1. Requirements

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

URL must be started with "https://"


4. Upload sw.js

importScripts("https://cdn.flarelane.com/ServiceWorker.js");

If you upload it correctly, you should be able to access it externally like this:


5. SDK Setup

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" });</script>

6. Test

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. Identify your user

FlareLane's device is 'anonymous' and you can match the device with your user based on the unique user ID that identifies your user.

Usually, when a user sign-up or log-in, you should execute setUserId.

FlareLane.setUserId("USER_ID");

8. Additional Setup

  • Data Integration

Download 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)

Setting up has many benefits. You can distinguish whether a user has signed-up, and push notifications can be sent based on the User ID.

To use or , integrate custom data via SDK or API:

sw.js
https://gp.flarelane.com/sw.js
User ID
Journeys
Message Personalization
Sign up