Wordpress plugin and Javascript SDK Integration Guide

LeadSarthi Push Notifications helps you send real-time notifications to your website visitors. Based on your website type, follow integration guide.

Wordpress Website - Plugin Integration


If your website is built with WordPress, you can use our dedicated plugin: "LeadSarthi Push Notifications."

Please note:Our WordPress plugin is currently under review by WordPress.org and is not yet available in the official repository. In the meantime, you can download and install the plugin directly using the link below.

Download Plugin

Rest assured that this plugin is safe to use. It strictly adheres to WordPress security guidelines and has successfully passed all 'Plugin Check' validation tests.

Once you have download the plugin zip file, its time to install it.

Step 1: Go to Plugin Upload Section

  1. Login into the wordpress website first.
  2. In the left sidebar of admin control panel, click Plugins → Add New
  3. Click the "Upload Plugin" button at the top

Step2: Upload the ZIP File

  1. Click "Choose File"
  2. Select the downloaded ZIP file:
    lead-sarthi-push-notifications.zip
  3. Click "Install Now"

Step 3: Activate the Plugin

  1. After installation completes, click "Activate Plugin"

Once the plugin is activated, then its time for plugin registration. (It is essential.)

🔑 Step 4: Get Your Registration ID

If you have not yet, added your website with us & obtained the required registration id then follow following steps.

  1. Visit:
    https://push.leadsarthi.com/dashboard/websites/
  2. Enter your website homepage URL
  3. Click Register
  4. Copy the generated Registration ID

⚙️ Step 3: Register the Plugin

  1. Go back to your WordPress dashboard
  2. Open LeadSarthi Push Dashboard(Find in the left sidebar of admin section)
  3. Paste the Registration ID
  4. Click Activate

What happens next?

  • Your Registration ID is verified with LeadSarthi servers
  • If valid → Plugin is activated
  • If invalid → An error message will be shown with the reason

Note: Once activated, the page will refresh automatically in a few seconds.

Thats it. If the plugin is successfully registered, then you are ready to create and publish push notifications in this website.


Custom Coded Website - SDK Integration Guide


If your website is not built using wordpress, then follow below guideline to integrate & activate our Javascript SDK.

Step 1

Download the following sw.zip file.

Download sw.zip

Once the download is complete, unzip the file to locate service_worker.js.

Upload this file to your website’s server (typically where your static files are stored, or any directory of your choice). However, for the SDK to function correctly, the file must be accessible from the root level of your domain.

For example, if your website is https://example.com, the file should be reachable at https://example.com/service_worker.js. Please configure your website’s routing as needed to ensure this path is active.

Step 2

Copy and paste the following code snippet immediately before the closing tag on every HTML page of your website.

<script>
window.LeadSarthiPushNotification = window.LeadSarthiPushNotification || [];
LeadSarthiPushNotification.push(function() { LeadSarthi.init({ appId: "REGISTRATION_ID"});});
</script>
<script src="https://push.leadsarthi.com/static/js/push_notification.js" async></script>

Be sure to replace the "REGISTRATION_ID" placeholder in the copied code with your actual registration ID.


🔑Get Your Registration ID

If you have not yet added your website & obtained the registration id then follow below instructions.

  1. Visit:
    https://push.leadsarthi.com/dashboard/websites/
  2. Enter your website homepage URL
  3. Click Register
  4. Copy the generated Registration ID

If you have already added your website and need the registration id, then visit https://push.leadsarthi.com/dashboard/websites/ and look for your listed website, there website's registration id is present.