Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: renamed to nn-webhooks-sdk

webhookd-sdk (Python)

Official Python SDK for NimbusNexus Webhooks — publish events, manage your endpoints / keys / deliveries, and verify the webhooks you receive.

pip install webhookd-sdk

Verify an incoming webhook (subscribers)

When webhookd delivers a webhook it signs the body with your endpoint's signing secret. Always verify the signature before trusting the payload — it proves the request really came from webhookd and wasn't tampered with or replayed.

from webhookd_sdk import verify

# In your webhook handler — pass the RAW request body bytes (do not re-serialize the JSON):
ok = verify(
    secret=ENDPOINT_SIGNING_SECRET,
    raw_body=request.body,
    signature=request.headers["X-Webhook-Signature"],
    timestamp=request.headers["X-Webhook-Timestamp"],
)
if not ok:
    return Response(status_code=400)  # forged, tampered, or outside the 300s replay window

Publish an event (producers)

from webhookd_sdk import Client, WebhookdAPIError

with Client("https://webhooks.example.com", api_key="whsk_…") as wh:
    try:
        event = wh.publish(
            "order.created",
            {"order_id": "ord_123", "total": 4200},
            idempotency_key="order-123",   # makes the publish safe to retry
        )
        print(event.event_uid, event.deliveries_created)
    except WebhookdAPIError as e:
        print(e.status_code, e.code, e.message)   # the stable {error:{code,message}} envelope

Transient failures (connection errors, 429, 5xx) are retried with backoff (a 429 honours Retry-After); other 4xx raise WebhookdAPIError.

Outbox / durable buffering (producers)

publish() calls webhookd synchronously — if webhookd is unreachable it raises and the event is lost. The write-first outbox decouples the two: enqueue() durably persists the event to a pluggable Store and returns IMMEDIATELY (no network); drain() (or a background drainer) ships the buffered events later. Every send carries Idempotency-Key = record.id, so a re-drain after a crash or a lost response never double-publishes — webhookd dedupes. Delivery is at-least-once: nothing is lost while webhookd is down.

from webhookd_sdk import Client, SQLiteStore

# 1. Configure a durable store (survives process restarts).
store = SQLiteStore("outbox.db")

with Client("https://webhooks.example.com", api_key="whsk_…", store=store) as wh:
    # 2. enqueue() instead of publish() — writes to the store and returns at once, NO network call.
    record_id = wh.enqueue("order.created", {"order_id": "ord_123", "total": 4200})

    # 3a. Drain on demand (returns {"sent", "failed", "remaining"}):
    wh.drain()

    # 3b. …or run a background drainer that calls drain() every 5s until the client closes.
    wh.start_drainer(interval_seconds=5)
    # ... your app keeps enqueuing; the drainer ships in the background ...
    wh.stop_drainer()   # also called automatically by Client.close()/__exit__

Idempotency guarantee. record_id is the idempotency_key you pass (or a generated UUID v4) and becomes the Idempotency-Key header on every delivery attempt for that record. If the process crashes after a send but before the response is recorded, the next drain() re-sends with the same key and webhookd returns the original event without re-fanning-out. A record that keeps failing is retried with capped exponential backoff up to max_attempts (default 10), then flagged dead (never retried again) and handed to the optional on_dead callback.

Built-in stores — pick one for Client(..., store=...):

Store Durable? Extra needed
MemoryStore No (in-process) — (stdlib)
FileStore(dir) Yes (per-record JSON files) — (stdlib)
SQLiteStore(path) Yes (transactional) — (stdlib sqlite3)
RedisStore(url) Yes pip install 'webhookd-sdk[redis]'
PostgresStore(dsn) Yes pip install 'webhookd-sdk[postgres]'

The core SDK stays zero-dependency; RedisStore / PostgresStore lazily import their driver only when you construct them.

Manage endpoints, keys & deliveries (operators)

The same Client wraps the control-plane API — register receivers, mint keys, and drain the dead-letter queue from code (needs an admin-scoped key). Management methods return the raw JSON as dicts (snake_case, exactly as the API sends); list methods return a page — {"items": [...], "next_offset": int | None}; delete/revoke return None (a 204).

from webhookd_sdk import Client

wh = Client("https://webhooks.example.com", api_key="whsk_admin_…")

# --- Endpoints ----------------------------------------------------------------
# Create a receiver — its signing secret is in the response exactly once, so persist it now.
ep = wh.create_endpoint(
    "https://your-app.example/webhooks",
    subscriptions=[{"match_kind": "prefix", "pattern": "order."}],
    description="orders service",
)
endpoint_id, signing_secret = ep["id"], ep["secret"]

wh.list_endpoints(environment="prod")        # {"items": [...], "next_offset": ...}
wh.get_endpoint(endpoint_id)

# PATCH — send only the keys you want to change (omitted = unchanged, None = cleared):
wh.update_endpoint(endpoint_id, {"max_attempts": 10, "status": "disabled"})

wh.rotate_endpoint_secret(endpoint_id)       # returns the new secret, once
wh.enable_endpoint(endpoint_id)              # recover an auto-disabled endpoint
wh.delete_endpoint(endpoint_id)              # -> None (204)

# --- API keys -----------------------------------------------------------------
key = wh.create_api_key("ci-publisher", scope="publish", expires_in_days=90)
print(key["key"])                            # shown once
wh.revoke_api_key(key["id"])                 # -> None (204)

# --- Deliveries / dead-letter recovery ----------------------------------------
for d in wh.list_deliveries(status="dead")["items"]:
    wh.redeliver(d["id"])

Develop

pip install -e '.[dev]'
pytest && ruff check . && mypy webhookd_sdk

Metadata

Release files for webhookd-sdk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webhookd-sdk 0.3.0
File Size Uploaded Provenance Actions
webhookd_sdk-0.3.0.tar.gz 22.8 kB With provenance Details for webhookd_sdk-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for webhookd-sdk 0.3.0
File Interpreter ABI Platform Actions
webhookd_sdk-0.3.0-py3-none-any.whl Python 3 none any Details for webhookd_sdk-0.3.0-py3-none-any.whl

Total release size: 40.4 kB

Release files / webhookd_sdk-0.3.0.tar.gz

Download URL webhookd_sdk-0.3.0.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0729c42aab57c194d4944f2a927c52d1766c1124bb1f64ae0b66bd01b6ea2bc5
BLAKE2b-256 checksum
How to use checksums
c6f9a54b2434a30ff1c86cf79243c2fadfb144f730c52e0be91c734025bcd280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 20, 2026.

Transparency log

Release files / webhookd_sdk-0.3.0-py3-none-any.whl

Download URL webhookd_sdk-0.3.0-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82d0e98c4fca98d950ae2d496da686ca246d98a27ecff9848fcad87dd2be18ce
BLAKE2b-256 checksum
How to use checksums
5a5986267cceafbbf2fe1fe602f3136af56553a031830ef2dfde2031e756f2da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 20, 2026.

Transparency log

Security for webhookd-sdk 0.3.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.

Select from 2 files

Attestation for webhookd_sdk-0.3.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 Jul 20, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page