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

sigma-js

v1.1.5

Published

JS client for sigma AB testing framework.

Downloads

60

Readme

sigma-client

Node / Browser library for sigma AB testing framework.

Installation

Include the "sigma.js" script. The sigma object will be added to your environment. In the browser do the following:

<script src="sigma.js"></script>

If you're using sigma-client with node.js start by installing it:

$ npm install sigma-client

then require the "sigma-client" module:

var sigma = require("sigma-client");

Usage

Check out the examples in the examples directory for some quick examples for how to use the library. Here's a very basic example in node:

var sigma = require('sigma-client');

var session = new sigma.Session({
    environment: {
        city: 'bj',
        fr: 'bd_sem',
        server: 'web00',
    },
});

var data = {
    experiment: 'test-exp',
    variants: ['alt-one', 'alt-two'],
    force: 'alt-one',
    traffic: {
        scope: { city: 'bj' },
    },
};
session.participate(data, function (err, res) {
    if (err) throw err;
    var variant = res.variant.name
    if (variant == 'alt-one') {
        console.log('default: ' + variant);
    } else {
        console.log(variant);
    }
});

When instantiating the session object you can pass optional params client, baseUrl, ipAddress, userAgent

var sigma = new sigma.Session({client: 12345, baseUrl: 'http://www.renrenche.com/api/sigma', ipAddress: '1.2.2.1', userAgent: 'ChromeBot'});

Client ID is a previously generated client id that you've previously stored. IP Address and User Agent are used for bot detection.

Forcing an variant

For debugging / design work it can be useful to force a page to load using a specific variant. To force an variant use the force parameter to participate(). If you're using sigma.js in the browser you can also just include a query parameter, e.g. /your-page?sigma-force-EXPERIMENT_NAME=ALTERNATIVE_NAME.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Write and run tests with npm test (requires mocha)
  4. Commit your changes (git commit -am 'Added some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request