Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 0 additions & 19 deletions .changeset/dispatchit-express-adapter.md

This file was deleted.

21 changes: 21 additions & 0 deletions packages/dispatchit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# dispatchit

## 1.1.0

### Minor Changes

- [#1](https://github.com/webamboos/dispatchit-sdk/pull/1) [`9411a15`](https://github.com/webamboos/dispatchit-sdk/commit/9411a15aad4df60c9cc3cc0b81e387d6e6eeb005) Thanks [@arpadgabor](https://github.com/arpadgabor)! - Adds an Express adapter. Import `dispatchitExpress` from `dispatchit/adapters/express` and mount it on any Express 4 or 5 app.

Because Express parses the request body before your middleware runs, the adapter needs the raw body to verify signatures. Capture it with a verify hook when you configure `express.json`, then mount the adapter after it:

```ts
app.use(
'/api/webhooks/dispatchit',
express.json({
verify: (req, res, buf) => {
;(req as DispatchitRequest).rawBody = buf
},
}),
dispatchitExpress(config)
)
```
2 changes: 1 addition & 1 deletion packages/dispatchit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dispatchit",
"version": "1.0.0",
"version": "1.1.0",
"description": "Framework-agnostic SDK for building Dispatchit webhook endpoints.",
"license": "MIT",
"repository": {
Expand Down
Loading