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 🙏

© 2025 – Pkg Stats / Ryan Hefner

primedata-js-sdk

v1.0.7

Published

PrimeData JS SDK

Readme

Prime Data - Web JS SDK

Prime Data - JS SDK tracking event

JavaScript Style Guide Build Status Security Rating Bugs Lines of Code Coverage Code Smells Quality Gate Status

Prime Data Web Tracker Javascript Library

This is the web tracker for apache-unomi ( http://unomi.apache.org/ )

This package can be used in a Javascript application to interact with Prime Data.

Getting started

Adds tracker to your app :

yarn add primedata-js-sdk

Then

follower.initialize({
     'Prime Data': {
         scope: 'my-app',
         url: 'http://unomi:8181',
     }
 });
 
follower.ready(function() {
    console.log("Unomi context loaded - profile id : "+window.cxs.profileId + ", sessionId="+window.cxs.sessionId);
});

Implicit page view event

In the initialize call, the tracker will generate an implicit page view event, which by default will be populated with the following information:

    window.digitalData.page = window.digitalData.page || {
        path: location.pathname + location.hash,
        pageInfo: {
            pageName: document.title,
            pageID : location.pathname + location.hash,
            pagePath : location.pathname + location.hash,
            destinationURL: location.href
        }
    }

Now if you want to provide your own custom page information for the initial page view, you can simply do it like this:

    follower.initialize({
            scope: 'myScope',
            url: 'http://unomi:8181', // we use an empty URL to make it relative to this page.
            initialPageProperties: {
                path: path,
                pageInfo: {
                    destinationURL: location.href,
                    tags: ["tag1", "tag2", "tag3"],
                    categories: ["category1", "category2", "category3"]
                },
                interests: {
                    "interest1": 1,
                    "interest2": 2,
                    "interest3": 3
                }
            }
        });

Also note that the FIRST call to follower.page() will be IGNORED because of this initial page view. This is the way that the Analytics.js library handles it. So make sure you are aware of this when calling it. This is to avoid having two page views on a single call and to be compatible with old versions that did use the explicit call.

Sending events

Here are some examples of sending events :

follower.page() // first call will be ignored as the initial page load is done in the initialize method

follower.identify("af285fa381f77778ec427c01d48764b863c14705", {
    phone_number: '0985490107',
    full_name: 'Nguyen Le Phong',
    email: '[email protected]'
});

follower.track('page_viewed', {
    title: 'How to Create a Tracking Plan',
    course: 'Intro to PrimeData CDXP'
});

As the PrimeData Tracker uses the Analytics.JS API, you can find more information about it here. All methods can be used on follower object, although not all event types are supported by PrimeData integration.