# HypeLab Analytics

The HypeLab SDK is a JavaScript SDK for writing applications that interact with the HypeLab ad servers from various front-end JS frameworks (e.g., React, Vue, etc.). The SDK provides a simple interface for application builders and abstractions for core data structures, ad rendering, and API request generation.

For user documentation, visit the [HypeLab Docs](https://docs.hypelab.com/analytics-quickstart).

## Building

In order to build the SDK, run `npm run build`. This will output a `bundle.js` file in the `dist` folder that can then be uploaded to the Rails API. The Rails API serves the latest analytics file from the `https://api.hypelab.com/v1/scripts/ha-sdk.js?v=0` endpoint.

## SDK Testing

HypeLab Analytics uses Cypress to check the build package. In order to run integration tests, make sure you build the latest bundle with `npm run build` and then simply run `npm run test` from the command line. The HTML pages in the `example` folder reference the `bundle.js` file in the `dist` folder.
