Skip to main content
GET
/
:projectId
/
api
/
v7
/
push-notifications
/
vapid-public-key
Get VAPID Public Key
curl --request GET \
  --url https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/vapid-public-key
{
  "publicKey": {}
}
Returns the VAPID (Voluntary Application Server Identification) public key for this project. The browser’s PushManager.subscribe() requires this key as applicationServerKey when creating a Web Push subscription. This endpoint is intentionally unauthenticated — a VAPID public key is not a secret (only the matching private key, which is never returned by any endpoint, provides security). The webPushTokenAdapter calls this automatically before the user has signed in, which is a common browser pattern. Returns { publicKey: null } if the web-push provider has not been configured for the project. Requires the push bundle.

Response

publicKey
string | null
The Base64url-encoded VAPID public key, or null if Web Push is not configured.
{ "publicKey": "BGE1YqnfxcY...Bm7uB4" }

Error Responses

{ "error": "...", "code": "database/tables-not-available" }

See Also