https://github.com/frain-dev/convoy-ingester
Serverless function for incoming webhooks.
https://github.com/frain-dev/convoy-ingester
Last synced: 28 days ago
JSON representation
Serverless function for incoming webhooks.
- Host: GitHub
- URL: https://github.com/frain-dev/convoy-ingester
- Owner: frain-dev
- License: mpl-2.0
- Archived: true
- Created: 2022-04-07T12:54:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-06T11:43:53.000Z (almost 4 years ago)
- Last Synced: 2024-06-19T19:40:58.663Z (over 1 year ago)
- Language: Go
- Size: 72.3 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Convoy Ingester
=========
Convoy Ingester is a serverless function that acts as a middleware between API providers and Convoy. This enables consumers benefit from Convoy without providers taking advantage of Convoy yet.
The plan is to make this first class support in Convoy, this repo is a prototype for that future.
### Functions
#### WebhookEndpoint
This function receives webhook events from the provider E.g. Paystack. acks the event and publishes the event to a pub/sub topic. To configure this function
set the environment variable - `WEBHOOK_ENDPOINT_ENV_VARS` in GitHub actions with:
```bash
WEBHOOK_TOPIC=,GOOGLE_CLOUD_PROJECT=,PAYSTACK_SECRET=
```
#### PushToConvoy
This function is triggered from the pub/sub topic earlier and pushes to Convoy. To configure this function set environment variable - `PUSH_TO_CONVOY_ENV_VARS` in GitHub actions with:
```bash
WEBHOOK_TOPIC=,GOOGLE_CLOUD_PROJECT=,CONVOY_GROUP_ID=,CONVOY_API_KEY=,CONVOY_PAYSTACK_APP_ID=
```
### How To
To run this function, you need to fork the repository. Follow this [article](https://www.honeybadger.io/blog/building-testing-and-deploying-google-cloud-functions-with-ruby/) to deploy these functions to Google Cloud Functions
### Topic Configuration
- Create a topic on the GCP console. Retrieve the topic's full name. E.g. `projects/{project-name}/topics/{topic-name}`
- Add the topic to the Github actions secret with key - `TRIGGER_RESOURCE`
### Push Request
```bash
curl --request POST \
--url "http://localhost:8080" \
--header "Content-Type: application/json" \
--header "X-Paystack-Signature: " \
--header "X-Forwarded-For: \
--data '{"event": "charge.created"}'
```
You can generate dummy hash [here](https://go.dev/play/p/NfFgzhtj-N)