Skip to content

Commit fd20673

Browse files
ankitjaininfolizokmshanamatthews
authored
Added a section on "Developing and Testing Webhooks" in existing page (#7456)
* Added a section on "Developing and Testing Webhooks" in existing page * Apply suggestions from code review Co-authored-by: Liza Mock <lizka920@gmail.com> * lint --------- Co-authored-by: Liza Mock <lizka920@gmail.com> Co-authored-by: Shana Matthews <shana.l.matthews@gmail.com>
1 parent 79904c8 commit fd20673

File tree

1 file changed

+16
-6
lines changed
  • src/docs/product/integrations/integration-platform

1 file changed

+16
-6
lines changed

src/docs/product/integrations/integration-platform/webhooks.mdx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ We've built an [example application](https://github.com/getsentry/integration-pl
1212

1313
</Note>
1414

15-
Webhooks allow your service to receive requests about specific resources, depending on your selection, such as installation, issues, and alerts:
15+
Webhooks are a way for two applications or services to communicate over the web, allowing one application to send automatic notifications or data updates to another in near real-time.
16+
17+
The concept is based on HTTP callbacks, where an HTTP POST request is sent to a specific URL (an HTTP endpoint in your tech stack) with a payload. Sentry uses JSON webhooks to get error notifications to your systems or services.
1618

1719
![Sentry integration webhook checkbox](webhook-checkbox.png)
1820

1921
## Headers
2022

21-
All webhooks will contain the following set of request headers:
23+
Sentry webhooks support various functionalities and are made up of four integral HTTP headers described below:
2224

2325
```json
2426
{
@@ -30,11 +32,11 @@ All webhooks will contain the following set of request headers:
3032
}
3133
```
3234

33-
The `Sentry-Hook-Resource` and `Sentry-Hook-Signature` are described below.
35+
The `Content-Type` header identifies the media type of the payload as JSON format. The `Request-ID` header provides a unique identifier for tracking and debugging specific events.
3436

3537
### `Sentry-Hook-Resource`
3638

37-
This is the resource that triggered the action. The action will be in the payload. The possible resources are listed below:
39+
This header lets you know which resource from the list below triggered an action:
3840

3941
- `installation`
4042
- `event_alert`
@@ -45,9 +47,11 @@ This is the resource that triggered the action. The action will be in the payloa
4547

4648
### `Sentry-Hook-Signature`
4749

48-
A hash generated using your Client Secret and the request itself. Used to verify the authenticity of the request.
50+
This header represents a cryptographic hash generated by your _Client Secret_. Its primary purpose is to make sure the request is authentic and comes from Sentry servers.
51+
52+
**Verifying the Signature**
4953

50-
#### Verifying the Signature
54+
The below code snippet lets you validate the signature with the event payload.
5155

5256
```javascript
5357
const crypto = require("crypto");
@@ -139,3 +143,9 @@ All webhook requests have some common elements.
139143
- [Comments](/product/integrations/integration-platform/webhooks/comments/)
140144

141145
- [Errors](/product/integrations/integration-platform/webhooks/errors/)
146+
147+
## Developing and Testing Webhooks
148+
149+
If you’d like to test webhook configuration and look at payloads before starting development, an HTTP catch-all service that provides a designated URL where you can receive HTTP payloads and inspect the JSON event payload can come in handy. After you’ve reviewed the relevant event payloads, you can begin development.
150+
151+
To make testing and debugging webhooks faster and easier, you can create local tunnels to get incoming webhook requests from Sentry to your local machine. There are various tools that let you pick a port or address (such as 3000 or 8080) to be tunneled, and then provide you with a temporary public URL that forwards requests to your local server.

0 commit comments

Comments
 (0)