Documentation

Powered by Algolia

JavaScript

You can integrate the Alan Button into a simple HTML page with JavaScript without any frameworks.

Getting Started

As script:

  1. Add the script tag to the page:

    <script type="text/javascript" src="https://studio.alan.app/web/lib/alan_lib.min.js"></script>
  2. Add the Alan Button in the script tag like this:

    alanBtn({
        key: "e3018cc76639126f974f1bf6b6929c1b2e956eca572e1d8b807a3e2338fdd0dc/stage"
    });

As NPM package:

  1. Install @alan-ai/alan-sdk-web using npm.

    $ npm npm install @alan-ai/alan-sdk-web --save
  2. Import alanBtn function from the @alan-ai/alan-sdk-web package and add the Alan Button to the page:

    import alanBtn from "@alan-ai/alan-sdk-web";
    
    alanBtn({
        key: "e3018cc76639126f974f1bf6b6929c1b2e956eca572e1d8b807a3e2338fdd0dc/stage"
    });

The alan-key is given above just as an example, use the key from your Alan Studio project in real life.