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.0.tar.gz (9.5 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.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: webhookd_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.5 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.0.tar.gz
Algorithm Hash digest
SHA256 acaf314483396353a083655a87f12d53a7df90e8b09bf76771039986aad579c2
MD5 b79eb5699c1edbe12c2eb1ff10e5259f
BLAKE2b-256 d9c1009d40efee0e69ca25a8e64865ccc8b0246ab88686dc71f4f3326c7a70ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for webhookd_sdk-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: webhookd_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43a402ecc650a1891017a71f0f0117b19d6ef06fc84d33075ffd15aefc9d6ce1
MD5 0c896f59c5cf60ce2f71305795dc13ba
BLAKE2b-256 ca978cccb1a5493a816f2ec21faebd3d08834c07ad87eebce4238ea24472abf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for webhookd_sdk-0.1.0-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