This website is no longer maintained. Please, visit documentation.indigitall.com to read our updated documentation.

npm integration

web push notifications with npm

Estimated integration time: 10 minutes.

If you use Wordpress,visit our specific guide here.

If you want to integrate through Google Tag Manager, then use this guide.

If you want to integrate in a standard way pulse here.


To integrate our web push notifications tool on your page you need:

  • an indigitall account

  • install the indigitall dependency with the following command:

    npm i indigitall-webpush

  • add the following code before the closing tag </body>:

Important: the appKey value is unique and personal. You can get it by accessing your account > settings > AppKey value

<script
  src="/en/node_modules/indigitall-webpush/sdk.min.js"
  onload="indigitall.init({
    appKey:'cambiaPortuAppKey',
    workerPath:'/node_modules/indigitall-webpush/worker.min.js',
    requestLocation:true
  })"
  async>
</script>


Check the integration


If everything went well, when you access your website again, you should see a message in your browser to allow notifications. Example:


New tag


Click Allow .


Then open the developer console (hit F12) and go to Console, you should see something like this:

[IND] Client:  Method: PUT
URL: https://device-api.indigitall.com/v1/device?appKey=(tuAppKeyAquĆ­)&deviceId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Request Body: {
  [...]
  "pushToken": "https://fcm.googleapis.com/fcm/send/xxxx",s
  "browserPublicKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "browserPrivateKey": "xxxxxxxxxxxx"
}
Response Code: 200
Response Message: OK
Response Body: {
  "deviceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "enabled": true,
  "platform": "webpush"
}


Note that Response Code has the value 200 .

If everything is correct, congratulations, you just need to create and send your first campaign!

Campaigns are managed from the control panel of your indigitall accoun. Access your account.

Resources

User guide: create campaigns, edit and more.

Wordpress Plugin integration guide

Google Tag Manager integration guide (GTM)

Contact us