---
title: "Use the Web Push standard for browser push · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/product-services/web-push-standard
updated: 2026-10-21
licence: "All rights reserved"
---

# Use the Web Push standard for browser push

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Recommended
- Chapter: [Product services](https://agentwranglers.se/playbook/stack/product-services)
- Rule: Send push messages to browsers through the Web Push standard with VAPID keys, using an open source library on the server.
- Cost: Open source. The standard is free and the libraries are open source. Each browser's push service delivers the message at no charge.
- How: Web Push is an open standard, so one send call works in Chrome, Firefox, Edge and Safari. In Python, pywebpush reached 1.0.0 in May 2017, and 2.5.0 shipped on 29 August 2026. It had about 2.4 million weekly downloads in October 2026, under MPL-2.0. In PHP, minishlink/web-push reached 1.0 in April 2016, and 11.0.0 shipped on 23 July 2026. It had about 2.6 million monthly downloads, under the MIT licence. In JavaScript, the npm web-push package last shipped in January 2024, so it fails the release test. Send from a Python or PHP service, or record that exception. Subscriptions are your own data, and the VAPID keys are yours, so no vendor holds them. Send each message as [Send web push with VAPID and an encrypted payload](https://agentwranglers.se/playbook/notifications/push-notifications/web-push-vapid) says. Remove dead subscriptions as [Delete dead subscriptions and tokens at once](https://agentwranglers.se/playbook/notifications/push-notifications/prune-push-subscriptions) says.
- Check: Every browser send signs with your own VAPID key pair. A send that gets status 404 or 410 deletes that subscription in a test.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Python example

```python
import json
import os
from pywebpush import webpush

def notify_order_shipped(subscription: dict, order_id: str) -> None:
    webpush(
        subscription_info=subscription,
        data=json.dumps({"title": "Your order has shipped", "body": f"Order {order_id} is on its way."}),
        vapid_private_key=os.environ["VAPID_PRIVATE_KEY"],
        vapid_claims={"sub": "mailto:support@example.com"},
    )
```

### PHP example

```php
use Minishlink\WebPush\Subscription;
use Minishlink\WebPush\WebPush;

function notifyOrderShipped(array $subscription, string $orderId): bool {
    $webPush = new WebPush(['VAPID' => [
        'subject' => 'mailto:support@example.com',
        'publicKey' => getenv('VAPID_PUBLIC_KEY'),
        'privateKey' => getenv('VAPID_PRIVATE_KEY'),
    ]]);
    $payload = json_encode(['title' => 'Your order has shipped', 'body' => "Order $orderId is on its way."]);
    return $webPush->sendOneNotification(Subscription::create($subscription), $payload)->isSuccess();
}
```

## Sources

- [RFC 8030 Generic Event Delivery Using HTTP Push](https://www.rfc-editor.org/rfc/rfc8030)
- [RFC 8292 VAPID for Web Push](https://www.rfc-editor.org/rfc/rfc8292)

## Related rules

- [Send web push with VAPID and an encrypted payload](https://agentwranglers.se/playbook/notifications/push-notifications/web-push-vapid) in Notifications
- [Delete dead subscriptions and tokens at once](https://agentwranglers.se/playbook/notifications/push-notifications/prune-push-subscriptions) in Notifications
- [Use Firebase Cloud Messaging for Android and Apple app push](https://agentwranglers.se/playbook/stack/product-services/fcm-push) in Software choices

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/product-services/web-push-standard">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use Keycloak when you need a sign-in server](https://agentwranglers.se/playbook/stack/product-services/keycloak-self-hosted)
- Next: [Use Firebase Cloud Messaging for Android and Apple app push](https://agentwranglers.se/playbook/stack/product-services/fcm-push)
- [Product services](https://agentwranglers.se/playbook/stack/product-services)
