skillfed

py-vapid

Simple VAPID header generation library

py-vapid v1.9.4 6.2M downloads/30d#1,957 on PyPI98
Copyleft license MPL-2.0 Active released

What it is and what it does

py-vapid is a minimal library for generating VAPID credentials used in WebPush authentication. VAPID is a voluntary standard that allows application servers sending push notifications to self-identify to push service providers. The library generates public/private key pairs and signs VAPID claims (JSON structures containing subscriber email, audience URL, and expiration timestamp) into HTTP headers that push services can verify.

The package works with cryptography as its sole runtime dependency and can be used either as a library in Python code or as a command-line tool (bin/vapid) for key generation and header signing. It handles the required VAPID claim fields (sub, aud, exp) and optional fields, auto-generating expiration timestamps when not specified.

Use it for:

  • Generate VAPID key pairs for a WebPush service during initial setup or key rotation
  • Sign VAPID claims into HTTP headers before sending push subscription updates to a push service
  • Create restricted subscription endpoints by extracting the applicationServerKey for client-side subscription
  • Manage VAPID expiration timestamps to prevent replay attacks in push notification workflows

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates VAPID (Voluntary Application Server Identification) headers and key pairs for WebPush subscription authentication between application servers and push service providers.

Yes. This is a focused, actively maintained library with low install friction and no known vulnerabilities. Install it if you're building a WebPush notification system and need to authenticate with push service providers. The MPL-2.0 license requires source disclosure of modifications but poses no barrier to typical use.

Install

py-vapid on PyPI

pip

pip install py-vapid

uv

uv add py-vapid

poetry

poetry add py-vapid

Installing py-vapid

Before you install

Low install friction with a single runtime dependency (cryptography). Actively maintained with a recent release and no known vulnerabilities.

License in practice

Licensed under MPL-2.0 (copyleft). You must disclose source code modifications and distribute under the same license if you modify and redistribute the package.

Quickstart

pip install py-vapid

from py_vapid import Vapid01

vapid = Vapid01()
vapid.generate_keys()
headers = vapid.sign({"sub": "mailto:admin@example.com", "aud": "https://push.example.com", "exp": "ExpirationTimestamp"})

Verify before relying

  • Whether the library supports VAPID protocol versions beyond the initial implementation
  • Performance characteristics when signing large batches of claims
  • Compatibility with specific push service providers and their VAPID requirements

Package facts

License MPL-2.0 (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — cryptography
Maintenance actively maintained — 221 days since the last release
Last repo commit
First released
Downloads 6,216,733/month — #1,957 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_vapid-1.9.4-py2.py3-none-any.whl

Keywords: push, vapid, webpush

Programming Language :: PythonProgramming Language :: Python :: 3Topic :: Internet :: WWW/HTTP

Tags

vapid key generationwebpush authentication headerspush notification signingvapid claims signingapplication server identificationwebpush vapid librarypush service authentication
webpushcryptographyauthentication

More WWW/HTTP packages