2.1.5 • Published 3 years ago

@paychex/collector-azure v2.1.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

@paychex/collector-azure

Provides an Azure Event Bus collector for use with a @paychex/core Tracker.

Installation

npm install @paychex/collector-azure

Importing

esm

import { eventHubs } from '@paychex/collector-azure';

cjs

const { eventHubs } = require('@paychex/collector-azure');

amd

define(['@paychex/collector-azure'], function(collectors) { ... });
define(['@paychex/collector-azure'], function({ eventHubs }) { ... });
require(['@paychex/collector-azure'], function(collectors) { ... });
require(['@paychex/collector-azure'], function({ eventHubs }) { ... });

iife (browser)

const { eventHubs } = window['@paychex/collector-azure'];

Usage

Construct a new Azure Event Hub collector for use in the @paychex/core Tracker by passing a configuration object with the following keys:

keytypedescription
namestringrequired The name of the Event Hub to connect to.
connectionstringrequired The full connection string of the Event Hub to connect to.
formatterFunctionoptional Function to use to format the TrackingInfo instance into an Azure Event Hub entry.
import { trackers } from '@paychex/core';
import { eventHubs } from '@paychex/collector-azure';

const hub = eventHubs({
  name: process.env.HUB_NAME,
  connection: process.env.HUB_CONNECTION
});

const tracker = trackers.create(hub);