![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Table of Contents
Wrapper around Push and Notifications API. Handles subscription and unsubscription. Provides some useful methods.
Needs service worker to be installed in any way. Provides an interface to perform service worker installation if needed.
You can find a basic example application including manifest.json and fully commented service worker in the example
folder.
To run the app use npm run local
command and navigate to http://localhost:5001.
import Push from 'push-js';
const push = new Push(); // All arguments are optional
push.subscribe().then(subscription => {});
push.unsubscribe().then(() => {});
There is a simple service worker provided with this package. It's needed to make notification events to work properly. You may use it as is, but the best way is to import it in your service worker, as shown in the example.
An options object that can contain some callbacks and a path to the service worker.
stateChangeCb
: receives state and an Error object if an error occurred.subscriptionUpdateCb
: receives subscription object (PushSubscription).logCb
: receives anything that should be logged.Creates and returns new subscription if it does n't exist, returns old otherwise.
Tries to unsubscribe. Returns resolved Promise anyway.
Returns permission state. See ./source/constants/states.js
.
Requests user permission to show notifications. Returns resolved or rejected Promise depending on user decision.
Checks browser support and returns Boolean.
Same as PushManager.getSubscription().
Accepts two parameters, same as new Notification
constuctor does. See MDN for the description.
Shows notification via service worker. Returns Promise resolved with corresponding Notification object.
FAQs
Push and Notifications API wrapper.
The npm package push-js receives a total of 24 weekly downloads. As such, push-js popularity was classified as not popular.
We found that push-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.