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

suggestgrid

v0.6.0-rc.2

Published

Personalization made Simple

Readme

SuggestGrid Node.js Client

We will walk through how to get started with SuggestGrid Node.js Client in three steps:

  1. Configuration

  2. Post actions

  3. Get recommendations

Getting Started

In this guide we will demonstrate how to display personalized recommendations on an existing Node.js project.

We have a movie catalog Node.js application, SuggestGridMovies, similar to IMDb. For logged in users we want to display movies that similar people viewed on movie pages. Let's implement this feature in five minutes with SuggestGrid!

1. Configuration

We are beginning the development by adding the client as a dependency.

'suggestgrid': '0.1.31'

Once you sign up for SuggestGrid, you'll see your SUGGESTGRID_URL parameter on the dashboard in the format below:

http://{user}:{pass}@{region}.suggestgrid.space/{app-uuid}

You can authenticate your application using SUGGESTGRID_URL environment variable like the example below:

var suggestgrid = require('suggestgrid')
suggestgrid.configure(process.env.SUGGESTGRID_URL)

Every recommendation logic needs to belong to a type. For this demonstration we can create an implicit type named as views. This could be done either from the dashboard or with a snippet like this:

var typeController = suggestgrid.TypeController;

typeController.getType('views', function (error, response) {
    if (error && error.errorCode == 404) {
        typeController.createType('views', {'rating': 'implicit'}, function (error, response) {
            if (!error) {
                console.info('Views type is created')
            }
        })
    }
})

2. Post actions

Once the type exists, let's start posting actions. We should invoke SuggestGrid client's suggestgrid.ActionController.postAction when an user views an item in our application.

We can do this by putting the snippet below on the relevant point:

var actionController = suggestgrid.ActionController

app.get('/movie/:id', function (req, res) {
    var action = new suggestgrid.Action({type: 'views', user_id: user.id, item_id: req.params.id})
    actionController.postAction(action, function (error, response) {
        if (error) {
            console.error(error)
        } else {
            console.log(response)
        }
    })
})

The more actions SuggestGrid gets, more relevant and diverse its responses are.

3. Get recommendations

Finally, let's show "movies similar users viewed" on movie pages.

SuggestGrid needs recommendation models for returning recommendations. Model generation is scheduled in every 24 hours. In addition, instant model generations can be triggered on the dashboard.

Once the first model generated for 'views' type, recommendations could be get using a snippet like the following:

var recommendationController = suggestgrid.RecommendationController;

function recommendItems(userId, callback) {
    recommendationController.recommendItems({type: 'views', user_id: userId}, callback)
}