Everything you need to integrate PushWave into your application.
Get PushWave running on your website in under 5 minutes.
Add the following snippet before the closing </body> tag on every page:
<script>
(function(w,d,s,id){
w.PushWave = w.PushWave || {};
w.PushWave.apiKey = 'YOUR_API_KEY';
var js = d.createElement(s);
js.src = 'https://www.pushwave.org/sdk/pushwave.js';
d.head.appendChild(js);
})(window, document, 'script', 'pushwave-sdk');
</script>
npm install pushwave-sdk
import PushWave from 'pushwave-sdk';
PushWave.init({ apiKey: 'YOUR_API_KEY' });
Download and place the service worker file at the root of your domain:
curl -o /public/pushwave-sw.js https://www.pushwave.org/sdk/pushwave-sw.js
https://yoursite.com/pushwave-sw.jsPushWave.init({
apiKey: 'YOUR_API_KEY', // Required
autoSubscribe: false, // Show prompt automatically?
promptDelay: 5000, // ms before showing prompt
swPath: '/pushwave-sw.js', // Path to service worker
tags: ['newsletter'], // Custom subscriber tags
});
| Parameter | Type | Default | Description |
|---|---|---|---|
| apiKey | string | — | Your PushWave API key (required) |
| autoSubscribe | boolean | true | Show prompt automatically on page load |
| promptDelay | number | 3000 | Delay in ms before showing the prompt |
| swPath | string | /pushwave-sw.js | Path to the service worker file |
| tags | string[] | [] | Tags to assign to the subscriber |
All API requests must include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Base URL: https://www.pushwave.org/api/v1
POST https://www.pushwave.org/api/v1/subscribe.php
{
"endpoint": "https://fcm.googleapis.com/...",
"auth": "base64-key",
"p256dh": "base64-key",
"browser": "Chrome",
"os": "Windows",
"device_type": "desktop"
}
POST https://www.pushwave.org/api/v1/campaigns.php
{
"title": "Flash Sale — 40% OFF",
"message": "Limited time offer!",
"url": "https://yoursite.com/sale",
"target": "all"
}
PushWave can send real-time events to your server via webhooks.
subscriber.created — New subscriber addedsubscriber.removed — Subscriber unsubscribedcampaign.sent — Campaign delivery completedcampaign.clicked — Notification clicked by subscriber