Socket
Socket
Sign inDemoInstall

@barchart/events-client-js

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@barchart/events-client-js


Version published
Maintainers
1
Created

Readme

Source

@barchart/events-client-js

JavaScript SDK for interfacing with Barchart's Event Tracking System

The Barchart Event Tracking System collects usage statistics from various software systems and exposes the following functionality:

  • Accepts and saves events (e.g. Job Started, Pizza Ordered, Lightning Struck, etc).
  • Accepts requests to generate log files containing events, given a customer, product type, and optional start and end dates.

This SDK simplifies interaction with the Barchart Event Tracking System, by exposing JavaScript classes with simple functions:

  • EventGateway.sendEvents (sends a new event(s) to the backend),
  • ReportGateway.startReport (triggers generation of a new report),
  • ReportGateway.getReportAvailability (checks progress of report generation), and
  • ReportGateway.getReport (gets the download link for a completed report)

Also, two utilities exist:

  • EventBatcher (Wraps an EventGateway, temporarily caching new events before sending them to the backend), and
  • EventFactory (Simplifies creation of event objects)

Examples

SDK Usage

A step-by-step guide for using the SDK can be found here: README_SDK.md.

Direct API Access

You can interact with the Barchart Event Tracking System without using this SDK. The documentation for the API can be found here: README_API.md.

Browser Test Client

Two example pages exist. One allows you to send manually generated events the backend. The other allows you to trigger report generation, check report status, and download reports. Please note, these clients are attached to the staging environment (not the production environment).

Load the examples from your local file system, here:

  • ./example/browser/example.event.html
  • ./example/browser/example.report.html

Or, visit the hosted page at:

Development

Code Documentation

The code is documented with JSDoc. While the output hasn't been committed to source control, you can generate the documentation by using the following commands:

> npm i jsdoc -g
> gulp document

Check for Lint

> gulp lint

Local Testing

Build the example pages manually:

> gulp build-example-bundles

Alternately, a gulp task exists automatically rebuilds the example page bundle, as you make changes to the code:

> gulp watch

FAQs

Last updated on 15 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc