![]() After entering all the values click on SAVE WEBHOOK and your WebHook is ready.For the fifth field, we need to enter the URL, where we want our event data to be delivered, ' ' - this needs to go in the WebHook URL field.' ' - this needs to go in the ABI URL field Now in the next field, we need to enter the URL to the ABI JSON.The event which we want to watch for is URLShortened, this needs to be entered in the event name field.The address at which our smart-contract is deployed is 0x19624fFa41FE26744E74FDBba77Bef967a222D4c - this needs to go in the contract address field.The name of our smart-contract is URLShortner which needs to go in the name field.We're setting up this WebHook so when someone uses this app to shorten a URL, the WebHook sends the event data. The smart-contract we'll use is a URL shortening app deployed on Ethereum Blockchain. Let's set-up a WebHook for a smart-contract event. We have made WebHooks available for all QuickNode customers as an Add On. Our application after receiving this data adds the user to the user database. So, what we need to do is set-up a WebHook with Stripe, which is configured to send the user information via a WebHook URL as a POST request to our application whenever a user pays via Stripe. ![]() Now whenever a new user makes a payment they need to be added to our user database. After setup is complete, run the following commands to install deps, and start the local dev server: cd myproject npm install npm start. Let's say we have a streaming service application and we've set-up Stripe to accept payments. To create a project, ensure you have Node.js 16.x or higher installed, and run: npm create enhance. WebHooks are very efficient as compared to the typical API method where we have to poll frequently. WebHook (also known as web callback or HTTP push API) is a way for an application to provide its real-time data to other applications. If you do not want to write a script for polling or do not want to run a server 24/7 you can use WebHooks - with WebHooks, we can get notified as soon as a new event is triggered. In polling we make requests to see if there are any new events. We often require API calls to other apps to get their event's status, which is called polling. Everything we do on the internet can be marked/considered as events and as the internet grows, these events grow in numbers.
0 Comments
Leave a Reply. |