Ember


Integrating with Alan

To integrate an Ember app with Alan:

  1. Install the @alan-ai/alan-sdk-web package:

    Terminal
    npm install @alan-ai/alan-sdk-web --save
    
  2. Install the ember-auto-import package to have an ability to use packages from npm:

    Terminal
    npm install ember-auto-import --save
    
  3. Add the following code to the app.js file in your project:

    Client app
    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
        }
      },
    });
    

For details, see Specifying the Alan button parameters.

Note

Regularly update the @alan-ai/alan-sdk-web package your project depends on. To check if a newer version is available, run npm outdated. To update the alan package, run npm update @alan-ai/alan-sdk-web. For more details, see npm documentation.

Trying the Alan sample app

In our GitHub repository, you can find a sample Ember app already integrated with Alan. Download the app to get an idea of how you can voice enable your Ember app and trigger actions in the app with voice commands.

What’s next?

Go to Script concepts to learn about Alan concepts and functionality you can use to create a voice script.