node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Server <-> Browser bridge for OpenNI skeleton.

Works with kinect.

Uses Socks.js (via Shoe).


Install libusb and OpenNI following the platform-specific instructions at

$ npm install openni-browser

Create Node Server

var kinectSock = require('openni-browser')();
var ecstatic = require('ecstatic')(__dirname + '/public');
var server = require('http').createServer(ecstatic);
kinectSock.install(server, '/skeleton');
server.listen(8080, function() {
  console.log('kinect socks server listening...');

Create Client

Copy browser/openni.js into the public folder.

In your HTML file include that script before the body close tag:

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

Inside a browser script:

Initialize connection to the server by providing a full or relative URL:

var skeleton = openni('/skeleton');

Listen for user events:

].forEach(function(userEventType) {
  sleleton.on(userEventType, function(userId) {
    console.log(userEventType + ' (' + userId + ')');

Listen for joint position changes:

jointNames = [
jointNames.forEach(function(jointName) {
  kinect.on(jointName, function(userId, x, y, z) {
    console.log('The joint ' + jointName + ' of user ' + userId +
      ' moved to (' + x + '' + y + '' + z + ')');

Connection Handling

The skeleton object will also emit:

  • connect — when there is a connection to the server
  • end — when the connection to the server is ended


See the examples folder.