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

@gotitinc/giap_javascript

v0.2.0

Published

Javscript SDK for your app to communicate with Got It Analytics Platform

Readme

GIAP - Javascript SDK

Description

Javscript SDK for your app to communicate with Got It Analytics Platform

Usage

npm install @gotitinc/giap_javascript

Import the package

import giap from '@gotitinc/giap_javascript';

Initialize the library

Use this method to initialize and setup the SDK. All other SDK methods must be called after this one

giap.initialize('YOUR_PROJECT_TOKEN', 'THE_GIAP_SERVER_URL');

Parameters

  • projectToken: String - required - your project token
  • serverUrl: String - required - GIAP server url
  • enableLog: Boolean - optional - set to true to enable development log

Create alias

Use this method with a string representing user id (required) right after user has just signed up

giap.alias('INSERT THE USER ID');

Identify

Use this method with a string representing user id (required) right after user has just logged in

giap.identify('INSERT THE USER ID');

Track

Use a string to represent the event name (required) and a object (optional) to represent the event properties.

giap.track('Visit', { economyGroup });

Set properties for current profile

At any moment after initializing the lib, you can set custom properties for current tracking profile

giap.setProfileProperties({ fullName: 'YOUR FULL NAME' });

Modify properties for current profile

Increase: Increment/decrement a numeric property

giap.increase('propertyName', 100);

Append: Add element(s) to a list property

giap.append('propertyName', ['one', 'two']);

Remove: Remove element(s) from a list property

giap.remove('propertyName', ['two']);

Reset

Use this method right after user has just logged out

giap.reset();

Notification

GIAP Javascript SDK handles everything asynchronously. Your app can be notified about important tasks done by the SDK.

Implement the following methods for your library:

giap.notification.didResetWithDistinctId = (distinctId) => {
  console.log(`GIAP didResetWithDistinctId: ${distinctId}`);
};

giap.notification.didEmitEvents = (events, responseData) => {
  console.log('GIAP didEmitEvent: ', events);
  console.log('   Response: ', responseData);
};

giap.notification.didUpdateProfile = ({ id, props }, responseData) => {
  console.log(`GIAP didUpdateProfile: ${id} with withProperties: `, props);
  console.log('   Response: ', responseData);
};

giap.notification.didCreateAliasForUserId = (
  { userId, distinctId },
  responseData,
) => {
  console.log(
    `GIAP didCreateAliasForUserId: ${userId} withDistinctId ${distinctId}`,
  );
  console.log('   Response: ', responseData);
};

giap.notification.didIdentifyUserId = (
  { userId, distinctId },
  responseData,
) => {
  console.log(
    `GIAP didIdentifyUserId: ${userId} withCurrentDistinctId ${distinctId}`,
  );
  console.log('   Response: ', responseData);
};

Installation for Development

Prerequisites

  • Install Node.js at least version 14 on your machine

Installing

  1. Clone this repository

    git clone https://github.com/tutoruniverse/giap_javascript.git
  2. Install dependencies

    cd giap_javascript
    npm install

Available Script

Testing

npm test

Run Demo App

  1. Edit config in demo/src/constants/app.js if needed
  2. Run
npm run start-demo

Production

npm run build