> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supahub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook Signature

> Supahub ensures security by signing every webhook sent, adding specific headers to each request.

Webhook Signature Verification involves two key headers:

<ParamField header="X-Supahub-Nonce" type="string">
  Type of event.
</ParamField>

<ParamField header="X-Supahub-Signature" type="string">
  Associated event data.
</ParamField>

<RequestExample>
  ```javascript node.js theme={null}
  import crypto from "crypto";

  function verify(request) {
    const supahubNonce = request.headers["X-Supahub-Nonce"];
    const supahubSignature = request.headers["X-Supahub-Signature"];
    const APIKey = "YOUR_API_KEY";

    const calculated = crypto
      .createHmac("sha256", APIKey)
      .update(supahubNonce)
      .digest("base64");

    return supahubSignature === calculated;
  }
  ```

  ```python python theme={null}
  import hmac
  import hashlib
  import base64

  def verify(request):
      supahub_nonce = request.headers.get("X-Supahub-Nonce")
      supahub_signature = request.headers.get("X-Supahub-Signature")
      api_key = "YOUR_API_KEY"

      calculated = base64.b64encode(
          hmac.new(api_key.encode(), supahub_nonce.encode(), hashlib.sha256).digest()
      ).decode()

      return supahub_signature == calculated
  ```
</RequestExample>
