Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@magicbell/webpush
Advanced tools
This package provides a convenient interface to subscribe to browser/web push notifications using MagicBell.
Install the package with npm:
npm install @magicbell/webpush --save
or yarn:
yarn add @magicbell/webpush
import { subscribe } from '@magicbell/webpush';
subscribe({
token: 'jwt-token',
host: 'https://api.magicbell.com',
project: 'string',
serviceWorkerPath: '/sw.js',
});
token String
The JWT token you received from the MagicBell API. This token is used to authenticate the request.
host String
Optional. The host of the MagicBell API. Defaults to https://api.magicbell.com
.
project String
The random subdomain that MagicBell generated for your service worker registration.
serviceWorkerPath String
The path to the service worker file. Defaults to /sw.js
.
A helper that can be used to register a service worker, prior to calling subscribe
. This preflight allows for a faster
subscription process. If this method isn't used, registration will be done during subscribe
.
Registration will be skipped if a service worker is already registered. In which case, the active registration will be returned.
The returned promise resolves when the registration is ready.
import { registerServiceWorker } from '@magicbell/webpush';
registerServiceWorker({
path: '/sw.js',
});
path String
The path to the service worker file. Defaults to /sw.js
.
New features and bug fixes are released on the latest major version of the magicbell
package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
Credit where credits due, this package is inspired by and based on the Stripe Node.js SDK.
FAQs
MagicBell WebPush SDK
The npm package @magicbell/webpush receives a total of 3,144 weekly downloads. As such, @magicbell/webpush popularity was classified as popular.
We found that @magicbell/webpush demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.