Skip to main content

Trigger webhooks from postgres

Project description

pg-notify-webhook

Implements a simple server process that listens to Postgres notifications, then fires off a webhook in response.

The content of the message is sent as the JSON payload to the webhook.

You can use this to invoke AWS Lambda functions (fronted by API gateway) or any other system that receives HTTP requests.

Install it as follows:

pip install pg-notify-webhook

You simply set up a config.yaml with the database connection string and define one or more channels and webhooks. Then start the server as follows:

pg-notify-webhook

Once the server is running, you can send notifications from Postgres:

NOTIFY one, '{"name": "Vijay"}'

config.yaml
DSN: postgresql://user:password@hostname:5432/database
channels:
  - one
  - two
webhooks: 
  one: https://postman-echo.com/get?foo1=bar1&foo2=bar2
  two: https://example.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pg-notify-webhook-1.3.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file pg-notify-webhook-1.3.tar.gz.

File metadata

  • Download URL: pg-notify-webhook-1.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.4.2 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for pg-notify-webhook-1.3.tar.gz
Algorithm Hash digest
SHA256 aa0d1c44f90bb8e47d7a444ad1fa80970fd884f23ba90b2b4f4fef287c5658e9
MD5 4558a4380eb71c74fc11c709bca1b487
BLAKE2b-256 3db84ab383f868ba545c978da5365a8436a1e80d779d4b4994a20678d120fed1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page