npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

altumanalytics

v2.0.4

Published

event tracking

Downloads

70

Readme

AltumAnalytics.js

AltumAnalytics.js is designed to collect customer data and send it to machine learning service for future processing.

We prefer to associate our library with a smart advisor called Altum.

Altum helps you measure your users, product, and business. It calculates statistic for your business and generate advises about your customers, provide charts and different integrations.

Documentation

Installation

Install from NPM

npm install --save altumanalytics

or if you want to specify version:

npm install --save altumanalytics@version      (i.e. npm install --save [email protected])

Include the library via script or manually and initialize it

The library is exported as a Universal Module (UMD), so there are couple ways of using it.

Ideally you would use module loader or compilation step to import using ES6 modules as:

import { Altum } from 'altumanalytics';

Altum.init({productId: 'PRODUCT ID', groupId: 'GROUP_ID', userId: 'USER ID'/*, options:{}*/});

In CommonJS modules then the library can be used as

const Altum = require('altumanalytics').Altum;

Altum.init({productId: 'PRODUCT ID', groupId: 'GROUP_ID', userId: 'USER ID'/*, options:{}*/});

or even using AMD script loading

define(['altumanalytics'] , function (module) {
  const Altum = module.Altum;

  Altum.init({productId: 'PRODUCT ID', groupId: 'GROUP_ID', userId: 'USER ID'/*, options:{}*/});
  // do whatever you want
});

And if you don't have any js environment setup, you can just include the library in the <head> tag using script below.

<script type="text/javascript">
      (function(t,e,r,o,u,a,m,n){t[a]=t[a]||{s:!1};
      t[a].s||(t[a].s=!0,t[a]['init']=function(c){t[a].c=c},r('load',function(){
        m=e.createElement(o);m.type="text/javascript";m.async=!0;m.src=u;
        n=e.getElementsByTagName(o)[0];n.parentNode.insertBefore(m,n)},!1));
      })(window,document,addEventListener,'script','https://cdn.jsdelivr.net/npm/altumanalytics@latest/lib/altumanalytics.min.js','Altum');

      Altum.init({
        productId:"PRODUCT ID",
        userId:"USER ID",
        groupId: "GROUP_ID",
        options:{ bufferSize: 20 }
      });
</script>

Instead of using npm you can also get library script from public CDNs: https://unpkg.com/, (i.e. https://unpkg.com/altumanalytics@latest/lib/altumanalytics.min.js) or https://cdn.jsdelivr.net/ (i.e. https://cdn.jsdelivr.net/npm/altumanalytics@latest/lib/altumanalytics.min.js)

After installation two global variables will be extractred: Altum - instance of the library and AltumAnalytics - module definition.

Initialization

Altum is exported as the Singleton, so you don't need to create a new instance.

Call Altum.init to initialize library.

  Altum.init(configurationObject);

configurationObject contains next properties:

| Property Name | Type | Required | Description |-------------------|-----------------|--------------|--------------| | productId | String | Required | Your unique product Id. Exception will be thrown if not provided.| | groupId | String | Required | Unique identifier per license.| | userId | String | Required | Currently signed in userId. (Usually Db Key).| | options | Object | Optional | Optional object with additional settings (see notice below).|

options is the optional object with next properties:

| Property Name | Type | Description | Default Value |-------------------|-----------------|--------------|--------------| | bufferSize | Number | Specify the size of buffer to store events before sending them to server. | 20 |

Note: Altum.init method can be called several times to change current product or current user.

Examples:

Init library after user sign in and specify the product:

Altum.init({productId: 'test', groupId: '1234', userId: '12345'});

Init library with custom buffer size:

Altum.init({productId: 'test', groupId: '1234', userId: '12345', options: {bufferSize: 5}});