Documentation

Powered by Algolia

Common API

The following common API is supported on all platforms where you can use the Alan Button:

Alan Button Methods

setVisualState(visualStateData:object)

Method for setting the visual state

visualStateData - object that represents a visual state

Examples:

callProjectApi(method:string, data:object, callback:function)

Method for calling a project API that was defined in Alan Studio project’s script

method - projectAPI method name that was defined in the voice script

data - any object with your data that should be passed to the voice script

callback - callback that could be called from project API method

// Voice script where your method defined like this:
projectAPI.setClientData = function(p, param, callback) {
  p.userData = param;
  callback();
};

Examples:

playText(text:string)

Method for playing voice

text - text that should be played

Examples:

playCommand(command:object)

Method for sending a command

command - object that represents a command

Examples:

activate()

Method for turning on the Alan Button programmatically

Examples:

deactivate()

Method for turning off the Alan Button programmatically

Examples: