We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOTE: Please test in a least two browsers (i.e. Chrome and Firefox). This helps with diagnosing problems quicker.
Please provide the following details, the more info you can provide the better.
Operating System: OSX | M2 Node Version: Node.js v20.15.1 web-push Version: "^3.6.7"
Please select any browsers that you are experiencing problems with:
Please list the browsers you are have tested this, including the version of the browser (i.e. Chrome Beta, Firefox Beta etc).
Please explain what behaviour you are seeing.
In attempts to send a push notification, I am getting
WebPushError: Received unexpected response code ... statusCode: 401, headers: { server: 'nginx', date: 'Thu, 19 Sep 2024 16:30:06 GMT', 'content-type': 'application/json', 'content-length': '153', vary: 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'strict-transport-security': 'max-age=31536000', via: '1.1 google', 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000' }, body: '{"code":401,"errno":109,"error":"Unauthorized","message":"InvalidSignature","more_info":"http://autopush.readthedocs.io/en/latest/http.html#error-codes"}', endpoint: 'https://updates.push.services.mozilla.com/wpush/v2/gAAAAABm6aTthg3Lgo5tIPppHebfwZ62cnzrnFtjeHR9n76VBbNPD3cJeby3BeS0fMuO4BhiZ6xcycXu7CfSphnkWc_TNPqkMYMZZJquJVWBs3d2YmmJlGVHXls2rZgR71YMmRh-zLYJOVatwLO4-Xi-YacaKWJCYqPjZdIIvOn2nXGuzRQryfU' }
However, using a colleagues pub/priv VAPID keys, it works, regardless of the endpoint. Ive tried generating the vapid keys with:
npx web-push generate-vapid-keys AND webPush.generateVAPIDKeys()
Please explain what you expected to happen
A successful web push notification to the endpoint.
Please provide a code sample that reproduces the issue. If there is a repository that reproduces the issue please put the link here.
import webPush from "web-push"; console.log("VAPID PUBLIC KEY:", process.env["VAPID_PUBLIC_KEY"]) console.log("VAPID PRIVATE KEY:", process.env["VAPID_PRIVATE_KEY"]) await webPush.sendNotification( { endpoint: 'https://updates.push.services.mozilla.com/wpush/v2/gAAAAABm6aTthg3Lgo5tIPpp...', keys: { auth: 'z4OmWpcIYzxYAxFFHls...', p256dh: 'BJ-RMwZ5oL0I5MXMtz4aZg8Ss2PBA_UP6yHjW58UVL0wdnWPy8rX5ioB...' }, }, "TEST", { vapidDetails: { subject: 'mailto:[email protected]', publicKey: process.env["VAPID_PUBLIC_KEY"]!, privateKey: process.env["VAPID_PRIVATE_KEY"]!, } } )
Please put any remaining notes here.
i am executing this code with
npx tsx test-vapid.ts
The text was updated successfully, but these errors were encountered:
No branches or pull requests
NOTE: Please test in a least two browsers (i.e. Chrome and Firefox). This
helps with diagnosing problems quicker.
Setup
Operating System: OSX | M2
Node Version: Node.js v20.15.1
web-push Version: "^3.6.7"
Problem
In attempts to send a push notification, I am getting
However, using a colleagues pub/priv VAPID keys, it works, regardless of the endpoint. Ive tried generating the vapid keys with:
Expected
A successful web push notification to the endpoint.
Features Used
Example / Reproduce Case
Other
i am executing this code with
The text was updated successfully, but these errors were encountered: