btrz-webhooks-emitter

2.0.0 • Public • Published

btrz-webhooks-emitter

Betterez library for emitting webhooks to the SQS queue.

Configuration

This lib will use the following ENV variables:

  • AWS_SERVICE_KEY
  • AWS_SERVICE_SECRET
  • SQS_QUEUE_URL

How to use

const btrzEmitter = require("btrz-webhooks-emitter");

const attrs = {
  providerId: "123",
  data: {foo: "bar"}
};

btrzEmitter.emitEvent("transaction.created", attrs);

btrzEmitter.emitEvent() will send asynchronously a message to SQS and no response, it will log an error if exists.

It's recommendable to send a third param with the logger you are using:

btrzEmitter.emitEvent("transaction.created", attrs, logger);

Denied fields

btrz-webhooks-denied-fields library will be consumed to filter off the possible denied fields.

Test

AWS_SERVICE_KEY=YOUR_KEY AWS_SERVICE_SECRET=YOUR_SECRET_KEY SQS_QUEUE_URL=YOUR_QUEUE_URL npm test

/btrz-webhooks-emitter/

    Package Sidebar

    Install

    npm i btrz-webhooks-emitter

    Weekly Downloads

    91

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    14.2 kB

    Total Files

    10

    Last publish

    Collaborators

    • betterez-support