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
{{ message }}
Repository navigation
Commit d5aec6b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(webhooks): accept form-encoded webhook bodies and an empty 200 acknowledgement
Hosted webhook endpoints now accept `application/x-www-form-urlencoded`
bodies. A verified form body that isn't JSON is routed as an object of
its fields, so Slack slash commands, Twilio and other form-posting
providers reach `webhook()` subscribers, agent session routes and
waiters like any JSON event:
```ts
export const miphy = webhook({
id: "miphy-command",
endpoint: slackCommands,
filter: "event.command == '/miphy'",
onEvent: async ({ event }) => {
// event = { command: "/miphy", text: "a raccoon dancing", user_id: "U...", response_url: "...", ... }
},
});
```
A repeated field becomes an array. A source's `formPayload` field (Slack
interactivity's `payload=<json>`) still takes precedence, and
verification is unchanged because it runs over the raw bytes first.
A source's response contract can also set `acceptedBody: "empty"` to
acknowledge with an empty 200 instead of the JSON receipt, for providers
such as Slack that show a non-empty reply to the user.
Mono-RevId: 8ab4361a8ae1e4ae19c029d41929ab6b26a03fb8
0 commit comments