Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document webhook header parsing behavior #959

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pages/docs/platform/webhooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Transforms are defined as simple JavaScript functions that accept three argument
The raw JSON payload from the POST request body
</Property>
<Property name="headers" type="object" attribute>
A map of HTTP headers sent along with the request as key-value pairs.
A map of HTTP headers sent along with the request as key-value pairs. Header names are standardized by making the first character and any characters following a hyphen uppercase and the rest lowercase. For more details, [check out](https://pkg.go.dev/net/http#CanonicalHeaderKey) the underlying implementation reference.
BrunoScheufler marked this conversation as resolved.
Show resolved Hide resolved
</Property>
<Property name="queryParams" type="object" attribute>
A map of parsed query string parameters sent to the webhook URL. Values are all arrays to support multiple params for a single key.
Expand All @@ -112,6 +112,12 @@ function transform(evt, headers = {}, queryParams = {}) {

### Example transforms

<Callout variant="info">
💡 Header names are standardized by making the first character and any characters following a hyphen uppercase and the rest lowercase. For more details, [check out](https://pkg.go.dev/net/http#CanonicalHeaderKey) the underlying implementation reference.

Remember to check your transforms for header usage and make sure to use the correct case.
</Callout>

<details>
<summary>**Github** - Using headers</summary>

Expand Down Expand Up @@ -237,4 +243,4 @@ inngest.createFunction(

<Callout>
💡 **Tip**: To test functions locally, copy an event from a webhook from the Inngest dashboard and use it with the Inngest dev server's `Send test` button.
</Callout>
</Callout>
Loading