You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,20 @@
1
1
# Changelog
2
2
3
+
## 5.8.1 (2025-06-26)
4
+
5
+
Full Changelog: [v5.8.0...v5.8.1](https://github.com/openai/openai-node/compare/v5.8.0...v5.8.1)
6
+
7
+
### Bug Fixes
8
+
9
+
***client:** ensure addOutputText is called on responses.retrieve ([d55bb64](https://github.com/openai/openai-node/commit/d55bb64f8022c1e861b4b4d1c23ad4cc0e80e536))
***docs:** update README to include links to docs on Webhooks ([586d5da](https://github.com/openai/openai-node/commit/586d5daf5babc9f12793201f1e1e4c79829151f0))
16
+
***webhooks:** make private methods really private ([0ee396a](https://github.com/openai/openai-node/commit/0ee396a2a0e03c794c7cfa3c9f1beb848fd77f1d))
17
+
3
18
## 5.8.0 (2025-06-26)
4
19
5
20
Full Changelog: [v5.7.0...v5.8.0](https://github.com/openai/openai-node/compare/v5.7.0...v5.8.0)
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,8 @@ await client.files.create({
128
128
129
129
Verifying webhook signatures is _optional but encouraged_.
130
130
131
+
For more information about webhooks, see [the API docs](https://platform.openai.com/docs/guides/webhooks).
132
+
131
133
### Parsing webhook payloads
132
134
133
135
For most use cases, you will likely want to verify the webhook and parse the payload at the same time. To achieve this, we provide the method `client.webhooks.unwrap()`, which parses a webhook request and verifies that it was sent by OpenAI. This method will throw an error if the signature is invalid.
Copy file name to clipboardExpand all lines: src/resources/webhooks.ts
+26-26Lines changed: 26 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -19,28 +19,6 @@ export class Webhooks extends APIResource {
19
19
returnJSON.parse(payload)asUnwrapWebhookEvent;
20
20
}
21
21
22
-
privatevalidateSecret(secret: string|null|undefined): asserts secret is string{
23
-
if(typeofsecret!=='string'||secret.length===0){
24
-
thrownewError(
25
-
`The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function`,
@@ -137,6 +115,28 @@ export class Webhooks extends APIResource {
137
115
'The given webhook signature does not match the expected signature',
138
116
);
139
117
}
118
+
119
+
#validateSecret(secret: string|null|undefined): asserts secret is string{
120
+
if(typeofsecret!=='string'||secret.length===0){
121
+
thrownewError(
122
+
`The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function`,
0 commit comments