Skip to content

Commit

Permalink
docs: update verifyAndParseRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
francisfuzz committed Sep 16, 2024
1 parent 693ca29 commit 5397672
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,21 @@ Convenience method to verify and parse a request in one go. It calls [`verifyReq
```js
import { verifyAndParseRequest } from "@copilot-extensions/preview-sdk";
const { isValidRequest, payload } = await verifyAndParseRequest(
request,
const { isValidRequest, payload, cache } = await verifyAndParseRequest(
request.body,
signature,
key,
keyId,
{
token: process.env.GITHUB_TOKEN,
}
);
if (!isValidRequest) {
throw new Error("Request could not be verified");
}
// `payload` has type support.
// `cache` contains the id and keys used for verification.
```
#### `getUserMessage()`
Expand Down

0 comments on commit 5397672

Please sign in to comment.