herfy-push
Web Push SDK for Herfy applications. Send browser push notifications using only your Control Center client_id and client_secret — no VAPID private key handling in app config.
Installation
pip install herfy-push
Usage
from herfy_push import HerfyPushClient, AsyncHerfyPushClient
# Sync
client = HerfyPushClient.from_credentials(
client_id="app_customer_care",
client_secret="your_secret",
control_center_url="https://cc.herfy.com",
)
client.send(
subscription={"endpoint": "...", "keys": {"p256dh": "...", "auth": "..."}},
payload={"title": "SLA breach", "body": "Ticket #123", "url": "https://app/tickets/123"},
)
# Async (FastAPI)
client = AsyncHerfyPushClient.from_env()
await client.send(subscription=..., payload=...)
public_key = await client.get_public_key() # hand to the browser's pushManager.subscribe()
How it works
- SDK authenticates with Control Center via
POST /oauth/token(cached, TTL configurable viaPUSH_TOKEN_CACHE_TTL). - SDK fetches VAPID keys from
GET /api/config/push(cached for the client's process lifetime). - SDK sends directly to the browser's push service via the Web Push protocol (
pywebpush) — no further Control Center round-trip per send.
Error handling
AuthError— Control Center rejected the client credentials.ConfigError— Control Center push config endpoint failed or is missing VAPID keys.PushSubscriptionExpiredError— the push service returned 404/410: the subscription is dead, delete it from your database.SendError— any other send failure.
Environment variables
CONTROL_CENTER_URL,AUTH_CLIENT_ID,AUTH_CLIENT_SECRET— required, used by.from_env().PUSH_TOKEN_CACHE_TTL(default240),PUSH_REQUEST_TIMEOUT(default15) — optional.
Metadata
Release files for herfy-push 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| herfy_push-1.0.0.tar.gz | 4.9 kB | With provenance | Details for herfy_push-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| herfy_push-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for herfy_push-1.0.0-py3-none-any.whl |
Total release size: 11.2 kB
Release files / herfy_push-1.0.0.tar.gz
| Download URL | herfy_push-1.0.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
283095aee5373219e13b9ef21af62a83f77b5d9d1280b80d573bc84bc20d5397
|
|
BLAKE2b-256 checksum How to use checksums |
17d1d14a04f5f3e9f1d296727d65c309f3f15476bf56105b8ee1670a8feed609
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / herfy_push-1.0.0-py3-none-any.whl
| Download URL | herfy_push-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87436fa95fb853d0e86dec868370b59516f7bc1135835f584bfc4c1427f9643f
|
|
BLAKE2b-256 checksum How to use checksums |
a733b1936750322a76b7ac09138156f58f197b6ccb8c413c58f5b1a385632211
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logSecurity for herfy-push 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for herfy_push-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.