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
Verify the request payload using the provided signature and key ID. The method will request the public key from GitHub's API for the given keyId and then verify the payload.
48
50
@@ -202,6 +204,87 @@ import { createDoneEvent } from "@copilot-extensions/preview-sdk";
202
204
response.write(createDoneEvent().toString());
203
205
```
204
206
207
+
### Parsing
208
+
209
+
<a name="parseRequestBody"></a>
210
+
211
+
#### `parseRequestBody(body)`
212
+
213
+
Parses the raw request body and returns an object with type support.
214
+
215
+
⚠️ **It's well possible that the type is not 100% correct. Please send pull requests to `index.d.ts` to improve it**
Convenience method to verify and parse a request in one go. It calls [`verifyRequestByKeyId()`](#verifyRequestByKeyId) and [`parseRequestBody()`](#parseRequestBody) internally.
console.log("Received a user confirmation", userConfirmation);
283
+
} else {
284
+
// The user's last response was not a confirmation
285
+
}
286
+
```
287
+
205
288
## Dreamcode
206
289
207
290
While implementing the lower-level functionality, we also dream big: what would our dream SDK for Coplitot extensions look like? Please have a look and share your thoughts and ideas:
0 commit comments