{"id":22793421,"url":"https://github.com/fivetran/fivetran-webhook-example-express-js","last_synced_at":"2025-04-16T18:52:00.573Z","repository":{"id":40245196,"uuid":"479564415","full_name":"fivetran/fivetran-webhook-example-express-js","owner":"fivetran","description":"A simple example of how to ingest webhooks from Fivetran","archived":false,"fork":false,"pushed_at":"2023-10-30T19:28:13.000Z","size":34,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T05:34:16.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fivetran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-08T23:17:33.000Z","updated_at":"2025-03-23T19:07:42.000Z","dependencies_parsed_at":"2023-02-01T08:16:23.327Z","dependency_job_id":null,"html_url":"https://github.com/fivetran/fivetran-webhook-example-express-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Ffivetran-webhook-example-express-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Ffivetran-webhook-example-express-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Ffivetran-webhook-example-express-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fivetran%2Ffivetran-webhook-example-express-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fivetran","download_url":"https://codeload.github.com/fivetran/fivetran-webhook-example-express-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249266646,"owners_count":21240792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T03:19:50.326Z","updated_at":"2025-04-16T18:52:00.557Z","avatar_url":"https://github.com/fivetran.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fivetran Webhooks Test Project in Express.js\nA simple example of how to ingest [Fivetran webhooks](https://fivetran.com/docs/rest-api/webhooks)! Check out the [same example in Python/Flask](https://github.com/fivetran-jimmyhooker/fivetran-webhook-example-python-flask)!\n\n## Setup\nWe'll use a really simple Express.js server combined with Ngrok to locally test webhooks. \n\nIf you're not familiar with Ngrok, it's a really fast, secure, and easy way to create tunnels to your desktop. This will make it so we can receive webhooks from Fivetran and show them on our local server.\n\n### Prepare\nYou'll need a Fivetran account and your key and secret that you can find in settings. Find out more in our [getting started guide](https://fivetran.com/docs/rest-api/getting-started).\n\nIn addition, head over to Ngrok, create an account, and install it: https://ngrok.com/download\n\nAnd finally, make sure you have [Node](https://nodejs.org/en/) installed (I generally stick to LTS). \n\n### Setup the project\nIf you are signing your webhooks and want to enable signature verification, create a `.env` file in the root of the project and add your signing secret in the below format:\n```\nSIGNATURE_SECRET=\n```\n\nThis will just install some node dependencies and start up the server on port `4242`. Run these from the root of the project folder. \n- Run `npm install`\n- Run `npm run start`\n\n### Open a tunnel\nRun this from your terminal to open a tunnel to port 4242 on your machine (which is what this express server will run on)\n- `ngrok http 4242`\n\nCopy down the https (secure) url that ngrok gives you\n\n### Create a webhook\nUse the url that Ngrok gave you and create a webhook. Make sure to add `/webhook` to the end, since that's the path to the webhook endpoint this server creates. You can utilize our [Postman collection](https://fivetran.com/docs/rest-api/api-tools#fivetranpostmancollection) for this.\n\nPOST https://api.fivetran.com/v1/webhooks/account\n```\n{\n  \"url\": \"https://a-bunch-of-numbers.ngrok.io/webhook\",\n  \"events\": [\n    \"sync_end\"\n  ],\n  \"active\": true\n}\n```\n### Test the webhook\nFire a test event to see the response in real time. Make sure to replace `{webhook_id}` with the actual id you got back in the previous step. \n\nPOST https://api.fivetran.com/v1/webhooks/{webhook_id}/test\n```\n{\n  \"event\": \"sync_end\"\n}\n```\n### Check the results\nYou should see a response similar to the following show up on your command line.\n```\n{\n  event: 'sync_end',\n  created: '2022-04-09T00:08:12.294Z',\n  connector_type: '_connector_type',\n  connector_id: '_connector_1',\n  destination_group_id: '_destination_1'\n}\n```\n\n### Build cool stuff!\nWe can't wait to see what you build on top of webhooks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Ffivetran-webhook-example-express-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivetran%2Ffivetran-webhook-example-express-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivetran%2Ffivetran-webhook-example-express-js/lists"}