Documentation

Powered by Algolia

Alan Electron Framework


Available on Web platform.

The Alan button can be added into your Electron application as a javascript library or NPM module.

Integration

  1. Install the @alan-ai/alan-sdk-web package and include the following script tag in the index.html page:

    $ npm install @alan-ai/alan-sdk-web --save
    <script src="node_modules/@alan-ai/alan-sdk-web/index.js"></script>

    Or just add the alan_lib.js library to your index.html page:

    <script type="text/javascript" src="https://studio.alan.app/web/lib/alan_lib.min.js"></script>
  2. Add the Alan button in the index.html:

    <script>
    	alanBtn({ 
    	key: 'YOUR_KEY_FROM_ALAN_STUDIO_HERE',
    		onCommand: (commandData) => {
    			if (commandData.command === 'go:back') {
    				// Call the client code that will react to the received command
    			}
    		},
    	});
    </script>

    For details, see Alan button parameters.

Integration example

See an example of the Electron app with the Alan button here.