Bridge
Webhooks
Create webhooks to be notified each time a payment is completed in your app.
You can create a webhook in your project dashboard under the Webhooks > Bridge tab. You'll be prompted to copy a secret key before saving the webhook. This will be used for verification on all webhook requests received by your backend.
The thirdweb SDK has a built-in function for parsing bridge webhook payloads
Verify payload before processing
Make sure to verify receiver, destination chain, token address and token amount in the payload before processing it further in your backend to ensure that payload represents expected state of the transaction.
You can verify certain fields in the payload by setting the verify parameter in the Bridge.Webhook.parse function.
By setting this, the Bridge.Webhook.parse function will throw an error if the payload does not match the expected values.
Apart from this you can add custom verification logic on the returned payload as per your needs.
If you prefer to handle verification manually, you can verify webhooks using the Web Crypto API (same method as the SDK):
To connect with other auth strategies, use external wallets, or sponsor gas for users, check out the following guides: