Set up PredictionIO credentials
var prediction = require('predictionio');
prediction.config.APP_KEY = '...';
prediction.config.APP_URL = 'http://localhost:8000' // default
Manage users
var prediction = require('predictionio');
prediction.user.getUser(userId, customOptions, callback);
prediction.user.postUser(userId, customOptions, callback);
prediction.user.deleteUser(userId, customOptions, callback);
Manage items
var prediction = require('predictionio');
prediction.item.getItem(itemId, customOptions, callback);
prediction.item.postItem(itemId, customOptions, callback);
prediction.item.deleteItem(itemId, customOptions, callback);
Create actions
var prediction = require('predictionio');
prediction.action.rate(userId, itemId, rate, customOptions, callback);
prediction.action.like(userId, itemId, customOptions, callback);
prediction.action.dislike(userId, itemId, customOptions, callback);
prediction.action.view(userId, itemId, customOptions, callback);
prediction.action.conversion(userId, itemId, customOptions, callback);
Fetch similar/recommended items
var prediction = require('predictionio');
prediction.engine.similarItems(engineName, itemId, maxNumber, customOptions, callback);
prediction.engine.recommendedItems(engineName, userId, maxNumber, customOptions, callback);