# Integrate with the Javascript Library

## Quick Start: UDT in Static HTML Page

{% embed url="<https://codesandbox.io/s/universal-data-tool-in-any-web-page-s8mh6>" %}

## Installation

Put a script tag at the top of your page importing the Universal Data Tool "vanilla" library.

{% hint style="info" %}
The vanilla library bundles all the Universal Data Tool dependencies together into a single file, making it easy to use anywhere!
{% endhint %}

```markup
<script
    type="application/javascript"
    src="https://unpkg.com/universal-data-tool@0.13.2/vanilla.js"
></script>
```

## Usage

Add a container element to your body. Then call `window.UniversalDataTool.open` to open the UDT in your element.

```markup
<body>
  <div id="udt"></div>
  <script type="application/javascript">
    window.UniversalDataTool.open({
      container: document.getElementById("udt"),

      // Your UDT dataset
      // https://github.com/UniversalDataTool/udt-format
      udt: {
        interface: {
          type: "image_classification",
          labels: ["A", "B"]
        },
        samples: [
          {
            imageUrl: "https://placekitten.com/408/287"
          }
        ]
      },

      // Called when sample is saved
      onSaveSample: (index, sample) => {
        console.log(index, sample);
      }
    });
  </script>
</body>
```


---

# 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.universaldatatool.com/integrate-with-any-web-page/integrate-with-the-javascript-library.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.
