Skip to content

Commit 9b306ae

Browse files
mirek26stainless-app[bot]
authored andcommitted
docs: update webhooks section in readme
1 parent ff17800 commit 9b306ae

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,13 @@ switch (event.event_type) {
197197
}
198198
```
199199

200-
### Parsing without verification
200+
### Parsing and verifying separately
201201

202202
```ts
203-
// Parse only - skips signature verification (not recommended for production)
203+
// Verify signature without parsing the event
204+
lithic.webhooks.verifySignature(body, headers)
205+
206+
// Parse only - skips signature verification
204207
const event = lithic.webhooks.parseUnsafe(body);
205208
```
206209

@@ -228,10 +231,6 @@ export default async function POST(req: Request) {
228231
> [!NOTE]
229232
> If you're using the pages router, you will need [this trick](https://vancelucas.com/blog/how-to-access-raw-body-data-with-next-js/) to get the raw body.
230233
231-
### Other methods
232-
233-
- `lithic.webhooks.verifySignature(body, headers, secret?)` – Only verify the signature without parsing
234-
- `lithic.webhooks.unwrap(body, headers, secret?)` – Verify and parse (returns untyped `Object`)
235234

236235
## Advanced Usage
237236

0 commit comments

Comments
 (0)