Skip to content

Commit 131808e

Browse files
author
Mohamed Elghobaty
committed
update readme
1 parent a78dd3b commit 131808e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ allowing you to validate that they were not sent by a third-party. You can read
109109
The 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.

0 commit comments

Comments
 (0)