Documentation

Powered by Algolia

Common API

The following common API is supported on all platforms.

Alan button methods

You can use the following methods of the Alan button:

setVisualState(visualStateData:object)

Method for setting the visual state.

Name Type Description
visualStateData object Object that represents the visual state

Examples:

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

Method for calling a project API that is defined in the script in the Alan Studio project.

Name Type Description
method string projectAPI method name that is defined in the voice script
data object Any object with custom data that must be passed to the voice script
callback function Callback that can be called from the 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.

Name Type Description
text string Text that must be played

Examples:

playCommand(command:object)

Method for sending a command.

Name Type Description
command object 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:

isActive()

Method for checking the Alan button state. Returns true if the Alan button is activated by the user or programmatically or false if the Alan button is deactivated by the user or programmatically.

Examples: