Quickstart

Get verified answers from your documents in a few minutes. Choose how you want to use Docket.

Set this up with your AI agent

Set up the Docket website widget in this project.

Docket answers questions from my own documents and checks every answer against them. It is hosted at https://YOUR_HOST. Docs: https://YOUR_HOST/docs?page=widget

My publishable key: pk_live_PASTE_YOUR_KEY_HERE
If that still says PASTE, ask me for the key. Never invent one.

What to do
1. Look at the project first: the framework, where the shared layout or index.html lives, and how scripts are loaded. If something important is unclear, ask me one short question before you change anything.
2. Add the widget script once, site-wide, before the closing </body> tag:
   <script src="https://YOUR_HOST/widget.js" data-key="MY_PUBLISHABLE_KEY"></script>
   In React or Next.js, load it once from an effect in a client component and clean up when it unmounts:
   const script = document.createElement("script");
   script.src = "https://YOUR_HOST/widget.js";
   script.dataset.key = "MY_PUBLISHABLE_KEY";
   document.body.appendChild(script);
   return () => { window.DocketWidget?.destroy(); script.remove(); };
3. Set only the options I ask for. Available data- attributes: data-theme (light, dark or auto), data-position (bottom-right or bottom-left), data-accent-color (a hex color), data-open (true), data-title (label for the chat button).
4. Check it works: start the dev server, load a page, and confirm a chat button appears and the browser console shows no Docket errors.

The key
- It must be a publishable key. It starts with pk_live_ and is safe to put in a web page. I create it in Studio: open the group, go to Keys, choose Publishable.
- Never use a key that starts with sk_ in the browser.

If the widget does not load
- "Missing data-key": the key is empty.
- "Origin is not authorized": add this site's address to the group's allowed domains in Studio.
- 404 from /api/widget-config: the script was loaded from a different server than the Docket app. Load it from https://YOUR_HOST.

When you finish, list the files you changed. Do not change anything unrelated.
  1. 1

    Add your documents

    Open Studio, choose Upload document, then create a group with New group and add the document to it. Wait until the document shows as indexed.

  2. 2

    Create a publishable key

    Open the group, go to Keys and generate a key of type Publishable. It starts with pk_live_. Copy it now: it is shown only once.

  3. 3

    Add the script to your site

    Paste this before the closing </body> tag, with your key.

    index.html
    <script
    src="https://YOUR_HOST/widget.js"
    data-key="pk_live_YOUR_PUBLIC_KEY"
    ></script>
  4. 4

    Try it

    Reload the page. A chat button appears in the corner. Ask something your documents answer, then something they do not: the second one gets your fallback message instead of a guess.

    Colors, position and more are covered in the widget reference.

Credits

Each answer is billed from your credit balance in Studio. When the balance reaches zero, answers pause until you top up.