Integrate real-time web push notifications on your website via the AlertWise Web SDK
Learn how the AlertWise Web SDK enables you to integrate web push notifications via JavaScript - giving you full control over subscription, targeting, and engagement on your website.
Check Documentation →If you’re looking for a ready-made web push notifications plugin that can be controlled programmatically, the AlertWise Web SDK is the tool you need. Integrating the AlertWise Web SDK into your website allows you to embed push subscription, targeting, and campaign logic directly within your website’s code. The SDK provided in the AlertWise Web Push Notifications service is also available in the free plan.
If you want to integrate web push notifications in any static website, single website, e-commerce website, then Web SDK gives you that layer of control and scalability.
Why a Web SDK Matters
- AlertWise has plugins for any WordPress, Shopify, or other plugin-supported website, but when you need programmatically controlled custom behavior, trigger-based workflows, or precise audience control on any type of website, you need a Web SDK.
- The web SDK allows the integration of web push notifications into any type of website via JavaScript. It enables deep customization, placing a great deal of control in the hands of the programmer.
- Through WebStreet you can control subscriptions, user permissions, service-worker logic, segmentation, and events.
Key Features of the AlertWise Web SDK
There are many web surfers in the market, but the following features make AlertVise Web SDK different from the rest.
Simple Initialization
Embed a small snippet to load and initialize the SDK:
<script src="https://cdn.alertwise.net/680b6b323434..../integrate/alert-wise.js"></script>
<script type="text/javascript">
alertwise = window.alertwise || [];
alertwise.push(["init", {
appId: "<APP_ID>",
alertwiseApiUrl: "https://api.alertwise.net",
applicationServerPublicKey: "BLlM0QIKIw6Kk...."
}]);
</script>Full Configuration Control
You can call updateAppConfig() to customize behavior at runtime—for example:
- Scope of service worker
- Default notification image or title
- Language
- Custom segments assigned on subscription
Subscriber & Permission Methods
The SDK includes methods to:
- Get the subscriber’s unique ID
- Retrieve subscriber details
- Check if push is supported in the browser
- Unsubscribe a subscriber
- Prompt and detect permission status (granted, denied, dismissed)
Event-Driven Architecture
You can listen to multiple events such as:
onReady(SDK initialised)onSDKError,onSWError(errors)onPermissionPromptDisplayed,onPermissionPromptGranted,onPermissionPromptDeniedonNotificationDisplayed,onNotificationClick,onNotificationClose
These allow you to hook into user flows and build custom analytics or UI responses.
Browser & Protocol Compatibility
AlertWise Web SDK supports all major browsers such as Chrome, Firefox, Edge, Safari, ChatGPT Atlas and all latest browsers. and works on both HTTP and HTTPS.
Offline & Deferred Delivery
Even if the subscriber’s browser is not connected to the internet (i.e., the user is offline), the notification message remains in the queue without loss. Whenever the user turns on the internet, they will receive the message.
How AlertWise Web SDK Works
Integration of Web SDK is quite easy, but you also need to know about its working.
1. Embed SDK
Add the SDK script and initialize using your appId
2. Configure Behavior
Override defaults using updateAppConfig() (optional but powerful).
3. Request and manage permissions
Use SDK methods to show opt-in prompts, monitor state, and react to permission changes.
4. Handle subscriptions
Collect subscriber IDs, monitor when they are added, retrieve details, and manage unsubscribe flows.
5. Trigger notifications
Once the push notifications integration is complete, you can send notifications to subscribers as soon as you have them. With the web SDK, you can build custom logic to trigger different events and send notifications.
6. Hook into events
Add listeners for clicks, dismissals, errors, and other user interactions to build richer experience flows.
7. Measure and optimize
Use SDK event data plus AlertWise analytics to refine your messaging strategy based on real behavior.
Web SDK Use Cases & Examples
Below are real life examples of the benefits of using it on the Web SDK website.
Customized Cart Abandonment Flow
- Detect when a user adds an item to cart (via your site code)
- Use SDK to subscribe the user or tag them with a segment like “cart-aband”
- Trigger a timed push notification after X minutes encouraging checkout
Premium Content Access
- When a user views a premium article section for the first time, tag them as “premium-visitor”
- Prompt via the SDK to subscribe for updates
- Send a follow-up notification when a new premium article drops
Geo-Targeted Local Offers
- Use the SDK or AlertWise dashboard to define segments by country, state or city
- Trigger local-offer notifications only to subscribers in that region
SPA or Web App Integration
- Single-Page Applications often have dynamic navigation. The Web SDK fits in well: handle routing and dynamic subscriptions, listen to events, and send real time notifications when the user meets criteria (e.g., completes a feature, takes action).
Benefits of the Web SDK
| Benefit | Description |
|---|---|
| Developer Flexibility | Full control over how/when users are subscribed and notified. |
| Custom Behavior | Hook into events, create custom triggers, adjust prompting logic. |
| Scalable Integration | Works on any site or app, supports large traffic and many subscribers. |
| Cross-Browser Support | Supports desktop & mobile, major browsers, HTTP/HTTPS (with best practices). |
| Offline Reliability | Messages queued and delivered when users reconnect. |
| Enhanced Analytics | Event hooks + AlertWise dashboard = deeper insights. |
The AlertWise web SDK provides full push notification capabilities by simply embedding a JavaScript code snippet into your website. Developers can control subscriptions, permission handling, event hooks, segmentation, and real-time messaging.