Get VAPID public key
GET
/api/push/vapid-public-key
const url = 'http://localhost:3001/api/push/vapid-public-key';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3001/api/push/vapid-public-keyGet the VAPID public key needed for push subscription
Responses
Section titled “Responses”OK
Media typeapplication/json
object
key
additional properties
string
Examplegenerated
{ "additionalProperty": "example"}Service Unavailable
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}