Neo's Playing Morpheus


    0.36.0 • Public • Published


    Helps consuming business events from the Event System (SQS).

    This package is oriented towards services that consume events as a secondary priority.

    This README describes the package in-detail. See here for a more complete overview of the Event System.

    If the main purpose of the service is consuming events, or the service wants to use SQS internally. Using the sqs-consumer by BBC is recommended.

    Getting Started

    You need to have nodejs and npm installed.

    $ npm install @narando/event-consumer


    First you need to import the package.

    import EventConsumer from "@narando/event-consumer";


    You need to set your AWS credentials and SQS settings for this package to work.

    Below you can find an example config.js.

      "aws": {
        "auth": {
          "accessKeyId": "",
          "secretAccessKey": ""
        "sqsEvents": {
          "region": "eu-central-1",
          "queueUrl": ""

    The queueUrl is specific for each service. Check that you have event-stream/subscription configured in narando/devops.


    Events can be listened on by subscribing to the exported EventEmitter. We use emittery as a replacement for EventEmitter to support asynchronous event handler. Using the canonical EventEmitter we can not reliably verify that the handler did not throw an error.

    The list of available events can be found here.

    EventConsumer.on("api:user:created", async event => {
      await sendWelcomeMessage(event.user);

    Required Parameters:

    • {String} Name of the event
    • {Function} async Handler that will be called to consume events


    As this package is part of the toolkit monorepo, please refer to the top-level README to learn about hacking on this package.

    Built With


    npm i @narando/event-consumer

    DownloadsWeekly Downloads






    Unpacked Size

    14.5 kB

    Total Files


    Last publish


    • narandosystem
    • marcmogdanz
    • apricote
    • brandolpho