Skip to content

Instantly share code, notes, and snippets.

Created February 20, 2014 21:25
What would you like to do?
var HueApi = require("node-hue-api").HueApi;
var hostname = "",
newUserName = null // You can provide your own username value, but it is normally easier to leave it to the Bridge to create it
userDescription = "device description goes here";
var displayUserResult = function(result) {
console.log("Created user: " + JSON.stringify(result));
var displayError = function(err) {
var hue = new HueApi();
// --------------------------
// Using a promise
hue.registerUser(hostname, newUserName, userDescription)
// --------------------------
// Using a callback (with default description and auto generated username)
hue.createUser(hostname, null, null, function(err, user) {
if (err) throw err;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment