/v1/client/webpush/vapid-public-keyAuthGet the web push key
The VAPID public key the browser subscribes with (`pushManager.subscribe({ applicationServerKey })`).
Response · 200 The public key.
public_key*stringThe workspace's VAPID public key (base64url): pass it as `applicationServerKey` to `pushManager.subscribe()`.
Example: "BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U"
Example
Request
GET https://api.notify.productcraft.co/v1/client/webpush/vapid-public-key
Authorization: Bearer YOUR_TOKENimport { Notify } from "@productcraft/notify";
// Reads PRODUCTCRAFT_API_KEY and PRODUCTCRAFT_WORKSPACE_ID from the environment;
// client routes take a recipient token: notify.client({ token })
const notify = new Notify();
const vapidPublicKey = await notify.client({ token: "rt_example_recipient_token" }).webpush.vapidPublicKey();notify.client({ token }).webpush.vapidPublicKey(options?): Notify.VapidPublicKey
Response
{
"public_key": "BEl62iUYgUivxIkv69yViEuiBIa-Ib9-SkvMeAtA3LFgDzkrxZJjSgSnfckjBJuBkr3qBUYIHBQFLXYp5Nksh8U"
}