File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,11 @@ allowing you to validate that they were not sent by a third-party. You can read
109109The SDK provides a convenient helper function to verify the signature, prevent replay attacks, and parse the payload to a typed object.
110110
111111``` ts
112- import { verifyPlainWebhook , PlainWebhookSignatureVerificationError , PlainWebhookVersionMismatchError } from ' @team-plain/typescript-sdk' ;
112+ import {
113+ PlainWebhookSignatureVerificationError ,
114+ PlainWebhookVersionMismatchError ,
115+ verifyPlainWebhook ,
116+ } from ' @team-plain/typescript-sdk' ;
113117
114118// Please note that you must pass the raw request body, exactly as received from Plain,
115119// to the verifyPlainWebhook() function; this will not work with a parsed (i.e., JSON) request body.
@@ -130,7 +134,7 @@ if (webhookResult.error instanceof PlainWebhookSignatureVerificationError) {
130134 // Consult the changelog or https://plain.com/docs/api-reference/webhooks/versions for more information.
131135} else if (webhookResult .error ) {
132136 // Unexpected error. Most likely due to an error in Plain's webhook server or a bug in the SDK.
133- // Treate this as a 500 response from Plain.
137+ // Treat this as a 500 response from Plain.
134138 // We also recommend logging the error and sharing it with Plain's support team.
135139} else {
136140 // webhookResult.data is now a typed object.
You can’t perform that action at this time.
0 commit comments