Skip to main content

Official Python SDK for NimbusNexus Webhooks — publish events + verify webhook signatures.

Project description

webhookd-sdk (Python)

Official Python SDK for NimbusNexus Webhooks — publish events, 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.

Develop

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webhookd_sdk-0.1.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webhookd_sdk-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file webhookd_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: webhookd_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for webhookd_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e433ed05af3012f1b887dcef45f3eea834eecda9645827e05718e0d68c51b53e
MD5 630fd560bb089823aca567a4e98bda54
BLAKE2b-256 dd5b5bdce708f5fb077927af2261baee3d14b1072a38a97f4a73f57945f04e51

See more details on using hashes here.

Provenance

The following attestation bundles were made for webhookd_sdk-0.1.1.tar.gz:

Publisher: publish.yml on NimbusNexus/Webhooks-sdks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webhookd_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: webhookd_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for webhookd_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9312ade839deb38b99f2d962ae3e9b077b50d6205cf51fab146abaaf0b41eb7a
MD5 afabd5cc6efa61ea69e6c4bf059f62b7
BLAKE2b-256 df3a89025f6dc8ccb73e177fec0dc1b4ed85f26856f0cb05a607fbd0947088a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for webhookd_sdk-0.1.1-py3-none-any.whl:

Publisher: publish.yml on NimbusNexus/Webhooks-sdks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page