Skip to content

Commit cb9f75b

Browse files
Update Webhook.md
update the help document for webhook secret key
1 parent ee8525d commit cb9f75b

1 file changed

Lines changed: 23 additions & 39 deletions

File tree

docs/docs/help/Settings/Webhook.md

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ A **Webhook Security Key** (also called a webhook secret) is a shared secret use
4747
1. Log in to your **OpenSign** account.
4848
2. Navigate to **Settings → Webhooks**.
4949
3. Add or edit a webhook endpoint.
50-
4. Generate a **Security Key** click Enable authentication.
50+
4. Generate a Security Key by clicking Enable Authentication, then click the Generate button.
51+
The webhook security key has been generated.
5152
- Example: `a50a904a2a329d761781dac27c984416a07396736ac5588b62c6fe226538fbca`
52-
5. Save the webhook configuration.
53+
6. Save the webhook configuration.
5354

54-
<img width="861" height="600" alt="webhook security key" src="https://github.com/user-attachments/assets/5a7702a6-998a-4d12-a073-5482c2300ffe" />
55+
<img width="861" height="600" alt="webhook security key" src="https://github.com/user-attachments/assets/6f61a23e-25a1-4785-b241-657af0c1eeb1" />
5556

5657
⚠️ **Important:** Store this key securely. Do not expose it in client-side code or public repositories.
5758

@@ -80,11 +81,14 @@ x-webhook-signature
8081

8182
---
8283

83-
## 🧪 Signature Verification Example (Node.js)
84+
// Process webhook event
85+
```
8486
85-
Below is a sample implementation to verify the webhook signature on your server.
87+
---
8688
87-
```js
89+
## 📦 Sample Webhook Payload
90+
91+
```json
8892
const crypto = require("crypto");
8993
9094
function verifySignature(req, secret) {
@@ -98,55 +102,35 @@ function verifySignature(req, secret) {
98102
99103
return receivedSignature === expectedSignature;
100104
}
101-
```
102-
103-
### Usage Example
104-
105-
```js
106-
const isValid = verifySignature(req, WEBHOOK_SECRET);
107-
108-
if (!isValid) {
109-
return res.status(401).send("Invalid webhook signature");
110-
}
111-
112-
// Process webhook event
113-
```
114-
115-
---
116105
117-
## 📦 Sample Webhook Payload
118-
119-
```json
120-
{
121-
"event": "viewed",
122-
"objectId": "d4LP0kKezS",
106+
console.log("Try programiz.pro", verifySignature({body: {
107+
"event": "created",
123108
"type": "request-sign",
124-
"file": "https://...pdf",
125-
"name": "Nu-international-application-form",
109+
"objectId": "SBEbnHwfrN",
110+
"file": "https://legadratw3d.ams3.digitaloceanspaces.com/c3f0bc11b84a87e6265de6bf28e5015e_uoeksXXU6FI5Op2B.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO00QAPRB3CQRWHWQ8ZB%2F20251219%2Fus-west%2Fs3%2Faws4_request&X-Amz-Date=20251219T152806Z&X-Amz-Expires=900&X-Amz-Signature=9635dfb8ee8fde933f881905a97f869578ef7e99b337d4b21a0805b8317fd70d&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
111+
"name": "Sample Test Doc Line Compressed",
126112
"note": "Please review and sign this document",
113+
"description": "",
127114
"signers": [
128115
{
129-
"name": "Mathew Wade",
130-
"email": "mathew.wade@opensignlabs.com"
116+
"name": "Peter Mark",
117+
"email": "peter.mark@opensignlabs.com"
131118
},
132119
{
133-
"name": "Steve Broad",
134-
"email": "steve.Broad@opensignlabs.com",
135-
"phone": "2678288322"
120+
"name": "kelvin bosch",
121+
"email": "kelvin.bosch@opensignlabs.com"
136122
}
137123
],
138-
"viewedBy": "mathew.wade@opensignlabs.com",
139-
"viewedAt": "Wed, 17 Dec 2025 13:46:05 GMT+5:30",
140-
"createdAt": "Wed, 17 Dec 2025 13:36:40 GMT+5:30"
141-
}
124+
"createdAt": "Sat, 20 Dec 2025 00:58:20 GMT+9:30"
125+
}, headers:{"x-webhook-signature":"52958fd3900f19ba6485319eb2622ef0ec4cf5ddfe36509cbe95eb706ed6b8c2" }}, "0906e8cbc88da0d5a6fd78162eb8e5e57ba7bd99bdc472145dc089d7f82b0a4a"));
142126
```
143127

144128
The corresponding signature is sent in the request header:
145129

146130
```
147131
x-webhook-signature: bcf57b06dde0c030d9423639824bad17ab7dd09ea3bf0a743773b95254ecf78e
148132
```
149-
---
133+
If the script returns true, it means the webhook is valid and has not been tampered with.
150134

151135
## ✅ Best Practices
152136

0 commit comments

Comments
 (0)