| Header | Description |
|---|---|
x-wavynode-hmac | Base64 encoded HMAC-SHA256 signature of the request body |
x-wavynode-timestamp | Timestamp of the request in milliseconds |
Using @wavynode/utils
The easiest way to verify requests is with the validateSignature function:
validateSignature parameters
validateSignature parameters
| Parameter | Type | Description |
|---|---|---|
method | string | The HTTP method of the request |
path | string | The path of the request |
body | object | The request body |
timestamp | number | The timestamp from the x-wavynode-timestamp header |
secret | string | Your integration’s secret from Project Settings in the dashboard |
timeTolerance | number | Time tolerance in milliseconds to prevent replay attacks (recommended: 300000) |
signature | string | The signature from the x-wavynode-hmac header |
Manual authentication
If you are not using the@wavynode/utils package, you can implement the authentication logic yourself.
Create the canonical string
Concatenate the following values separated by
:::- The uppercase HTTP method (
GET,POST, etc.) - The lowercase request path (e.g.,
/webhook) - The stringified request body with keys sorted alphabetically, or
{}if no body - The timestamp from the
x-wavynode-timestampheader
Create the HMAC signature
Create a
sha256 HMAC of the canonical string using your integration’s secret as the key. Base64 encode the result.