Documentation

Powered by Algolia

React

Getting Started

  1. Install the @alan-ai/alan-sdk-web package and import the alanBtn into your component:

    $ @alan-ai/alan-sdk-web --save
    import alanBtn from "@alan-ai/alan-sdk-web";

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

    <script type="text/javascript" src="https://studio.alan.app/web/lib/alan_lib.min.js"></script>
  2. Add the Alan Button to your React component (for example, in the the componentDidMount method).

    componentDidMount() {
        this.alanBtnInstance = alanalanBtn({ key: 'e3018cc76639126f974f1bf6b6929c1b2e956eca572e1d8b807a3e2338fdd0dc/stage' });
    }

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

    See an example of the React app with the Alan Button here.