samples
samples copied to clipboard
important question subscription keys
I have such code on the server. It logs user keys for subscribing service wokers to the server.
exports.PushUsers = (req,res) =>{ const subscription = req.body
console.log("ITSKEY",subscription.keys.p256dh )
On the external interface there is code that is responsible for subscribing to the push notification server.
function sendSubscription(subscription) {
return fetch(${process.env.REACT_APP_API_URL}/push/user/
, {
method: 'POST',
body: JSON.stringify(subscription),
headers: {
'Content-Type': 'application/json'
}
})
}
Can I find out what subscriptions user has subscription.keys?
P.S. I tried to log the subscription object. But there are no keys in it. Apparently, the mechanics of their formation are encapsulated.
Ы
That is an interesting question!