> ## Documentation Index
> Fetch the complete documentation index at: https://sleekplan.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the JavaScript widget

> Add the Sleekplan feedback widget to your site with a single script tag, then optionally swap in your own trigger button and notification badges

The JavaScript widget is the recommended way to embed Sleekplan in your product. Installation takes fewer than five minutes and requires only basic access to your site's HTML.

<Steps>
  <Step title="Find your snippet">
    Log in to Sleekplan and go to [**Settings → Widget**](https://app.sleekplan.com/settings/widget). Your personal code snippet is shown there and looks like this:

    ```html theme={"system"}
    <script type="text/javascript">window.$sleek=[];window.SLEEK_PRODUCT_ID=XY;(function(){d=document;s=d.createElement("script");s.src="https://client.sleekplan.com/sdk/e.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
    ```

    The `SLEEK_PRODUCT_ID` value is unique to your product — leave it as-is when you paste the code.
  </Step>

  <Step title="Add it to your HTML">
    Place the snippet immediately before the closing `</head>` tag:

    ```html theme={"system"}
    <html>
      <head>
        <!-- your existing head content -->

        <!-- Sleekplan widget -->
        <script type="text/javascript">window.$sleek=[];window.SLEEK_PRODUCT_ID=XY;(function(){d=document;s=d.createElement("script");s.src="https://client.sleekplan.com/sdk/e.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();</script>
      </head>
      <body>
        <!-- your page content -->
      </body>
    </html>
    ```

    <Tip>
      If you cannot edit `<head>`, place the snippet before `</body>` instead.
    </Tip>

    If the widget does not appear on the first load, clear your browser cache and reload the page.
  </Step>

  <Step title="(Optional) Use your own trigger button">
    Disable the default button in **Settings → Widget** if you want to use a button from your own UI. Then add a data attribute to any HTML element to make it open the widget:

    ```html theme={"system"}
    <!-- Opens the widget (default view) -->
    <button data-sleek>Feedback</button>

    <!-- Opens the feedback board -->
    <button data-sleek-feedback>Feedback</button>

    <!-- Opens the changelog -->
    <button data-sleek-changelog>Changelog</button>

    <!-- Opens the roadmap -->
    <button data-sleek-roadmap>Roadmap</button>
    ```

    ### Add a notification badge

    Add a badge attribute alongside your trigger to display an unread count:

    | Attribute              | Shows count for                                        |
    | ---------------------- | ------------------------------------------------------ |
    | `data-badge`           | All notifications                                      |
    | `data-badge-feedback`  | Feedback activity (status updates, comments, mentions) |
    | `data-badge-changelog` | New changelog entries                                  |

    ```html theme={"system"}
    <button data-sleek-changelog data-badge-changelog>
      Changelog
    </button>
    ```
  </Step>
</Steps>

<Note>
  After installing, control the widget with the `$sleek` SDK — see [SDK overview](/sdk/overview), [User setup](/sdk/user-setup), and [Single Sign-On](/authentication/single-sign-on).
</Note>
