PubNub is distributed as an NPM package here: https://npmjs.org/package/pubnub

Install the PubNub Node SDK: npm install pubnub


In your application, require the PubNub library: 

// PubNub = require('pubnub');  // ES5
import PubNub from 'pubnub';  // ES6
 
var pubnub = new PubNub({
    subscribeKey: "mySubscribeKey",
    publishKey: "myPublishKey",
    secretKey: "secretKey",
    uuid: "my_server_uuid",
    ssl: true
});


Visit the official PubNub Node SDK docs for more details.