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

kdp

v1.1.5

Published

Kantar Development Platform Node SDK

Downloads

55

Readme

KDP Node SDK

This Node SDK allows you to use KDP as an authentication mechanism for your application or API.

Pre requisites

You'll need a few things to get started, firstly you'll have to create a new app on the KDP dev site, go to the URL below and create your app..

http://dev.researchplatform.tnsglobal.com/#/RegisterApp

Make sure you add the following for Url and Redirect URL, then you will be taken to your App Management page.

URL: http://localhost:8080/ Redirect URL: http://localhost:8080/TokenHandler

And go!

Initialise a new Node project, follow the onscreen instructions.

npm init

Install the kdp package and the express package

npm install kdp --save
npm install express --save

Then create an index.js file and code add the following code, remember to replace the APP ID and APP SECRET from your App Management pages on the KDP site.

// require the needed express and kdp modules
var express = require('express');
var kdpMod = require('kdp');

// set up your KDP config, you can grab these details from app management on the KDP site.
var kdpConfig = {
    https: false,
    url: "dev.researchplatform.tnsglobal.com",
    app_id: "---INSERT YOUR APP ID HERE---",
    app_secret: "---INSERT YOUR APP SECRET HERE---",
    app_name: "My Node app"
}

// create a new instance of the KDP module helpers
var kdp = kdpMod(kdpConfig);

// set up your express app
app = express();

// bind KDP in to the app, this will do all of the redirection and authentication require
// it basically creates the cookies we need to identify a user
kdp.init(app);

// Ok, lets set up an endpoint, this will just be route on your express app with some KDP code inside
//
//   Requirements:
//      The user must be authenticated
//      The user must have BasicAccess permission
//
app.get('/', function (req, res) {

    // use KDP to authorize and check permission
    kdp.authorize(req, res, "BasicAccess", function(user){

        // log the fact the user has logged in to KDP
        kdp.log(user.first_name + ' ' + user.last_name + ' just logged in', user.user_id);

        // send the response and say 'Hello' to your user
        res.send('Hello ' + user.first_name + ' ' + user.last_name + '!');
    });
});

// finally start up the server
app.listen(8080, function () {
    console.log('Example KDP app listening on port 8080!');
});

Finally, try out the magic!

node index.js

What next?

Try the Node.js KDP API Template here...

https://github.com/TNSGlobal/kdp-node-api-template