Webhooks
The ThunderStack Cloud supports webhooks to notify users about events in their nodes. This document explains how to use ThunderStack webhooks and provides example payloads.
Last updated
The ThunderStack Cloud supports webhooks to notify users about events in their nodes. This document explains how to use ThunderStack webhooks and provides example payloads.
Last updated
You can add a webhook endpoint to your node by editing the node's settings:
Navigate to your node and click Settings.
Locate the field named Webhook URL.
Enter the endpoint where you'd like ThunderStack to send requests.
Note down your public key from the settings, as it will be used to verify requests.
When creating a new node via the API, you can provide a Webhook URL in the settings. This allows ThunderStack to send webhook notifications to your specified endpoint. You can update this URL later through the node's settings if needed.
To verify webhook requests, retrieve the public key from the following URL:
This public key is used to validate the X-ThunderStack-Signature
header included in each webhook event.
When an event is triggered, ThunderStack sends a POST request to your webhook endpoint. The request includes:
A JSON payload with details about the event.
A header named X-ThunderStack-Signature
containing a digital signature created with ThunderStack's private key.
Verification Steps
Validate the Signature: Use the public key to verify the X-ThunderStack-Signature
header.
Validate the Payload: Ensure the nodeId
in the payload matches the expected node or endpoint.
The JSON payload sent to your webhook endpoint has the following structure:
Status Values
The status
field within details
can have one of the following values:
RUNNING: The node is running.
STARTING: The node is starting.
PAUSED: The node is paused.
FAILED: The node has failed.
IN_PROGRESS: An operation is currently in progress.
Use HTTPS: Always use HTTPS for your webhook endpoint to ensure data security during transit.
Signature Verification: Validate the X-ThunderStack-Signature
header using the public key.
Payload Validation: Ensure the nodeId
field matches the expected node.
This ensures secure, reliable, and real-time notifications for your nodes.
Hereβs an example of a webhook handler in JavaScript/TypeScript: