https://github.com/itwin/webhooks-api-polling-sample-app
https://github.com/itwin/webhooks-api-polling-sample-app
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/itwin/webhooks-api-polling-sample-app
- Owner: iTwin
- License: mit
- Created: 2021-08-04T10:40:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T03:34:29.000Z (almost 2 years ago)
- Last Synced: 2025-01-01T04:48:12.432Z (4 months ago)
- Language: TypeScript
- Size: 446 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Webhooks event polling sample application
Node.js (Express) application that can capture webhook events, store the events in Azure Queue and provide an API endpoint for event polling.
## Prerequisites
1. Create "Service" type application in .
2. Prepare an existing iModel that your client has access to.
3. Deploy this application (e.g. Heroku/Netlify or any other preference, more information can be found [here](https://medium.com/itwinjs/deploying-the-itwin-viewer-to-a-web-host-d45c5cfdf0cf)).
4. Provide your configuration values in `.env` file.When started this application will create a new webhook for related iModel from the configuration, from this point it's up to you to trigger any of the events for that iModel. Normally this should be one-time deployment task and webhook information should be stored in application configuration.
The application expects the events to be delivered to `[POST] https://HOSTNAME/events` and the webhook will be automatically configured to do so. Any captured event by the application will be stored in Azure Queue which at the end is used to pull the events from using other application endpoint `[GET] https://HOSTNAME/events`.
> Webhook created by this application will expire after 30 minutes and will stop sending the events. This can be changed by updating webhook configuration in `services/api.ts` file.