Skip to content

Pushwoosh/web-push-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pushwoosh Web Push Notification SDK

A client-side JavaScript SDK for web push notifications supporting Chrome, Firefox, and Safari. Published to npm as web-push-notifications and distributed via CDN.

Getting started

Installation

Install dependencies:

npm install

Development

Start the local dev server:

npm start

Runs webpack-dev-server on https://localhost:8003 with the CDN build configuration.

Building

npm run build          # development build
npm run build:prod     # production build (minified)
npm run release        # production build + zip package

Code quality

npm run check:types    # TypeScript type-check
npm run check:lint     # ESLint
npm run lint:fix       # auto-fix ESLint issues

What it does

  • Provides the Pushwoosh Web Push SDK for integrating browser push notifications into websites
  • Handles push subscription management across Chrome, Firefox, and Safari (including legacy Safari APNs)
  • Includes a Service Worker for receiving and displaying push notifications
  • Ships UI widgets: subscription popup, subscription button, subscription prompt, and in-app inbox
  • Communicates with the Pushwoosh backend API for device registration, event tracking, and inbox messages
  • Published as:

Integration

<script src="//cdn.pushwoosh.com/webpush/v3/pushwoosh-web-notifications.js" async></script>
<script>
  var Pushwoosh = Pushwoosh || [];
  Pushwoosh.push(['init', {
    apiToken: 'YOUR_DEVICE_API_TOKEN',
    applicationCode: 'XXXXX-XXXXX',
    defaultNotificationTitle: 'Pushwoosh',
    autoSubscribe: true
  }]);
</script>

Key dependencies

  • TypeScript, Webpack 5, Babel
  • No runtime framework dependencies (vanilla JS/TS)
  • @pushwoosh/logger (internal)

Links

About

Web Push Notifications

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors