# Widget installation

&#x20;

1. **Install the script.** Add the code below to every page on which you want to enable Checklist. Copy and paste it before the **`</body>`** tag on each page.

   ```javascript
   <script>
   (function(a,l,v,i,s){
     a._Alviss=[];
     a.Alvis=function() {a._Alviss.push(Array.prototype.slice.call(arguments));}
     a.alvis_config={alvis_id:"{{YOUR_ALVIS_ID}}"};
     i=l.getElementsByTagName('head')[0];
     s=l.createElement('script');s.async=1;
     s.src=v;
     i.appendChild(s);
   })(window,document,'//assets.getalvis.com/alvis-onboard-1.0.19.js');
   </script>
   ```
2. **Optional.** After adding the code, go to your website or web app and load any of the pages you just updated. Call `window.Alvis("boot")` to make sure Alvis is installed.
3. **Show checklist to your user.** Once you have a logged in user on your site (after they have authenticated and you have their user IDs available) you call the following to identify the user. **For Intercom,** **Make sure to use the user\_id that you use to identify users, so we can match them. For Hubspot, make sure to use the email of the current logged in user.**

   ```javascript
   window.Alvis("identify", "{{YOUR_UNIQUE_USER_ID}}");
   ```

   After a user is identified, the launcher will be shown at the bottom right corner.
4. Whenever the URL or route changes, you need to call **`window.Alvis("page")`** for Alvis to check if or which checklist should be shown.&#x20;

   ```javascript
   window.Alvis("page");
   ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.checklist.getalvis.com/widget/installation-widget.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
