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 🙏

© 2026 – Pkg Stats / Ryan Hefner

splyt-js-sdk

v0.0.1

Published

The SPLYT SDK for Javascript and NodeJS

Readme

The SPLYT SDK for Javascript

Welcome! This SDK allows you to integrate websites and web-based applications with SPLYT, which provides analytics and insights about your app. In addition, SPLYT empowers you with the ability to take actions that will improve your users' engagement.

Note that this SDK currently assumes that your Javascript code will be running in a browser.


Initialization

  1. Source Splyt.data.js or Splyt.data.min.js in your document.

     <script src="Splyt.data.js"/>
  2. As early as you can, initialize SPLYT with your unique customer ID. You can find your customer ID in the Products tool on splyt.com, in the format of: org-product-env In order for sent data to be valid, you will need to have set a user ID, device ID, or both. If you do not specify a device ID, one will be requested from SPLYT's servers or re-loaded from localStorage.

  3. Users and devices can be passed either as a single identifier, or as an object that contains a field named id. When using the object approach, you can also specify a set of properties to associate with the user or device.

  4. Begin a session. As early as possible, call {@linkcode Splyt.Session.begin} to mark the beginning of a period of activity.

     Splyt.Session.begin();

Instrumentation

Add instrumentation that describes your users and their interaction with your site or app. The {@linkcode Splyt.Instrumentation} namespace provides APIs for this purpose.

APIs also exist to address some of the most common scenarios; for example, APIs in {@linkcode Splyt.Session} are useful for describing user sessions, and {@linkcode Splyt.Purchasing} can be used to report purchases that users make from your site or app. We encourage you to use use these APIs where applicable, as they enable several predefined metrics and visualizations on the SPLYT web site.

Here are few best practices to keep in mind:

  • Both a user ID and device ID are not required, but you must set at least one of them before you can start sending data.
  • As soon as you learn of changes to the user's or device's state, you should report them to SPLYT (using APIs such as {@linkcode Splyt.Instrumentation.updateUserState} or {@linkcode Splyt.Instrumentation.updateDeviceState}, respectively). This is important because you will want to understand which of your users are more likely to perform some desired activity, such as a purchase. So, whenever possible, be sure to report updates to user and/or device state to SPLYT before beginning a new transaction that describes an activity they performed.

Tuning and Testing

  1. If you are using the tuning system, variables will be cached for you after calling {@linkcode Splyt.init}.

  2. Now you can retrieve a named tuning variable.

     var myVar = Splyt.Tuning.getVar("myVar", "myDefaultValue");
  3. If needed, you can refresh the values of tuning variables at any point by calling the {@linkcode Splyt.Tuning.refresh refresh} method:

     Splyt.Tuning.refresh();

Charts

If you are using the charting portion of the SDK, take these additional steps:

  1. Source Splyt.all.js or Splyt.all.min.js in your document, rather than Splyt.data.js or Splyt.data.min.js.

     <script src="Splyt.all.js"/>
  2. When initializing the SDK, pass the API key that you created from the Products tool on splyt.com. You can also set the SDK to only initialize for charts with the chartOnly parameter; see the {@linkcode Splyt.Charts} documentation for details.


Sample Applications

This SDK includes a sample app called BubblePop, a simple shell game that demonstrates basic integration of data collection, tuning, and testing. It also shows how to report purchases to SPLYT.

To run the sample, open samples/BubblePop/index.html in your web browser. The sample has been tested to work properly in recent versions of Chrome, Firefox, and Safari.


Copyright Row Sham Bow, Inc. 2014