Skip to main content

Webhook Basics

Creating Webhooks

You can create a webhook within our console or through our SDK
Navigate to Project Settings > Webhooks and select the events as follows
TS

Editing a Webhook

After creating a webhook, you can edit the events and endpoint that the webhook is associated with. Please refer to the Events section for more information on the events that you can listen to.
Navigate to project settings and select the webhook you wish to edit
TS

Regenerating Webhook Secret

You can regenerate the secret associated with a webhook. This will invalidate the previous secret, and you will need to update your application to use the new secret in order to correctly verify the webhook payload.
Navigate to Project Settings > Click the three dots of your chosen webhook > Regenerate Secret
TS

Deleting a Webhook

After creating a webhook, you can delete it at any time. This will instantly invalidate the webhook, and Hop will no longer send any requests to the endpoint associated with the webhook.
Navigate to Project Settings > Click the three dots of your chosen webhook > Delete Webhook
TS

Webhook Payload

Request Headers

With every webhook request sent to your endpoint, Hop will include a signature header. This will help you verify that the request is coming from Hop, and not a malicious/third-party source. Header Example:

Request Body

When an event occurrs that the webhook is listening to, Hop will send a POST request to the endpoint you specified when creating the webhook. The request body will contain a JSON object. Body Example:

Verify Webhook Payload

To verify the webhook payload to ensure that it is coming from Hop, we provide a utility function in the @onehop/js SDK. Similar to the Stripe SDK, you can also construct an event to get type safe access to the webhook payload.
TS

Example

For a full example using express - see here

Events

Ignite

Project