VapidConfig - viames/pair GitHub Wiki

Pair framework: VapidConfig

Pair\Push\VapidConfig reads Web Push VAPID settings from environment.

Required .env variables:

  • PUSH_VAPID_PUBLIC
  • PUSH_VAPID_PRIVATE
  • PUSH_VAPID_SUBJECT

Methods

publicKey(): string

privateKey(): string

subject(): string

Each method throws RuntimeException if value is missing/empty.

Example

$config = new \Pair\Push\VapidConfig();

$public = $config->publicKey();
$private = $config->privateKey();
$subject = $config->subject();

Practical notes

  • subject should be a contact URL or mailto: value.
  • Keep private key secret and never expose it to frontend.
  • Public key is the one used by browser subscription flows (PairPush.subscribe).

See also: WebPushSender, PushDispatcher, Configuration-file.