A NodeJS module to help with push notifications and authentication.
JavaScript
Latest commit aee1f60 Mar 2, 2016 @jairajs89 jairajs89 Merge pull request #3 from kikinteractive/remove-push
Remove cards push
Failed to load latest commit information.
lib Remove cards push Mar 1, 2016
.gitignore upgrade to kik.js May 19, 2014
README.md Remove cards push Mar 2, 2016
kik.js Remove cards push Mar 2, 2016
package.json Bump version to 1.1.0 Mar 2, 2016

README.md

Kik API - NodeJS Library

For any webapp, some features will require having a backend. This NodeJS package makes verifying user data easy for those developing against the Kik browser API.

Links

Usage

Getting started

npm install kik-lib

Alternatively, you can include the library in your package.json:

{
  "dependencies" : {
    "kik-lib" : "1.0.0"
  }
}

Now you can use the library in your code:

var kik = require('kik-lib');

Authentication

kik.verify() accepts 3 arguments and a callback function. This method handles all responses outlined in the Authentication Docs and will automatically retry requests where applicable.

// the user we want to verify
var username = 'kikteam';

// the hostname of your app
var host = 'myapp.com';

// the signed data from the client. http://dev.kik.com/docs/#identity-auth
var signedData = 'mySignedData';

kik.verify(username, host, signedData, function (err, unsignedData) {
  if (err) {
    // not verified
  } else {
    // do something with unsignedData
  }
});

Anonymous authentication

kik.anonymousVerify() accepts 3 arguments and a callback function. This method handles all responses outlined in the Anonymous Authentication Docs and will automatically retry requests where applicable.

// the anonymous user we want to verify
var anonToken = 'getThisFromTheClient';

// the hostname of your app
var host = 'myapp.com';

// the signed data
var signedData = 'mySignedData';

kik.anonymousVerify(anonToken, host, signedData, function (err, unsignedData) {
  if (err) {
    // not verified
  } else {
    // do something with unsignedData
  }
});