Docs Navigation +

Node.js SDK has an official library for  Node.js. It's available under the Apache Public License 2.0.and should be usable in commercial and Open Source projects.


The package on npm has the latest version of the code:

You can use npm to install:

npm install

… or add it to your package.json file.

You can also fork the repository on Github.

… or download the latest release:


var FuzzyAIClient = require('');

var apiKey = 'API key from';

var client = new FuzzyAIClient(apiKey);

var agentID = 'ID from';

var inputs = {temperature: 87};

client.evaluate(agentID, inputs, function(err, outputs) {
if (err) {
} else {
console.log("Fan speed is " + outputs.fanSpeed);


This is the main class; it's what's returned from the require().

FuzzyAIClient(apiKey, apiRoot) You have to get an apiKey from . Keep this secret, by the way. serverRoot is the root of the API server. It has the correct default '' but if you're doing some testing with a mock, it can be useful.

This is the main method you need to use:

evaluate(agentID, inputs, callback) Does a single inference. agentID is on the main page for the agent on . The inputs is an object, mapping input names to numeric values. callback is a function with the signature function(err, outputs), where outputs is an object mapping output names to numeric values.

These might be useful but you normally don't need to mess with them.

  • getAgents(callback) userID is the user ID, not the API key. callback is a function with the signature function(err, agents), where agents is an array of objects with id and name properties, one for each agent the user has.
  • newAgent(agent, callback) userID is the user ID. agent is an agent object with at least properties inputs, outputs, rules. callback is a function with the signature function(err, agent) which returns the fully-realized agent with all its properties like timestamps and IDs.
  • getAgent(agentID, callback) Gets a single agent by ID. callback is a function with the signature function(err, agent).
  • putAgent(agentID, agent, callback) Updates an agent. callback has the signature function(err, agent) which will return the updated version.