Install

One tag, a few attributes, and a choice about how you want updates to reach you.

  1. 1

    Get the agent's key

    Dashboard → your agent → Settings → API Credentials. The install card there shows the key in full and the tag with the key already in it, ready to copy. The key starts tb_ and is publishable: it is meant to be in your page's source, and it is guarded by the domains you allow rather than by being secret.

  2. 2

    Allow your domain

    Settings → Allowed Domains. Add the site the tag will be on. A key with no domain on its list is refused everywhere — which is the safe default, and also the most common reason a first embed does not answer.

  3. 3

    Paste the tag

    html
    <script
      src="https://cdn.tigerbase.cloud/v2"
      data-api-key="tb_your_key_here"
      defer
    ></script>

The tag in your stack

It is a plain script tag, so anything that can put one on a page can install the widget. These are the usual places — pick the tab for your stack and the choice is remembered across the docs.

index.html
<!doctype html>
<html lang="en">
  <body>
    <!-- your page -->

    <script
      src="https://cdn.tigerbase.cloud/v2"
      data-api-key="tb_your_key_here"
      defer
    ></script>
  </body>
</html>

In a single-page app, mount it once, high up — the root layout, not a page. The widget attaches itself to <body>, so it stays put while your router swaps views underneath it and the conversation survives navigation.

TipWhy the React and Vue tabs build the tag by hand

A <script> written straight into a component is not something either framework reliably runs — Vue strips it from templates, and React inserts it as markup the browser does not execute. Creating the element and appending it always works. The widget still reads data-api-key from that element exactly as it would from a tag you wrote in HTML. Putting the plain tag in your app's index.html works just as well.

The attributes

data-api-keyRequired. The agent's publishable key. Everything else about the agent is looked up with it. Without it the tag loads the bundle and deliberately starts nothing.
data-targetOptional. A CSS selector for an element to render inside, for the inline layout. Without it the widget floats over the page.
data-api-urlOptional. Where the backend is. Only for local development or a self-hosted install — left off, it is Tigerbase's own API.
data-langOptional. "ar" (or any "ar-…" code) makes the widget Arabic and "en" makes it English, whatever the dashboard or the page says. Leave it off to follow the agent's Language setting — see Language below.
deferRecommended. The tag works without it, but a script that runs before <body> exists has nowhere to mount and has to wait for the document anyway.

Language and direction

The widget's own words — the placeholder, the buttons, its error messages — and its direction are decided once, when it starts, by the first of three that says anything: data-lang ("ar" or "en") on the tag (or defaultLang in init()), then the agent's Settings → General → Language, then your page's <html lang>.

TipSet it once, in the dashboard

The agent's Language setting is the one to rely on: it follows the agent onto every site without a tag edit. Any value starting with ar — ar, ar-EG — is Arabic, right to left; anything else is English.

Which URL to point at

The same bundle is served under several names, and the name you paste is a promise about what you get later.

Most sites end at /v2, which is what the dashboard gives you.
/v2The latest 2.x. Gets fixes, never gets a breaking change. When 2.1.0 ships, this starts serving it and your page gets it without anyone editing a tag. Browsers cache it for an hour. This is what the dashboard gives you and what most sites should use.
/widget.umd.jsThe latest of everything, including a future 3.x with breaking changes. Cached five minutes, so a fix reaches you the same day. Use it only if you follow every release. The bare https://cdn.tigerbase.cloud/ serves the same file.
/widget/2.0.0/widget.umd.jsExactly this build, forever. Cached for a year and never changes. For a site that has to be able to say what was on its page a year from now — and which has therefore opted out of receiving fixes.

WarningPin only if you mean it

A pinned version will not receive a security fix either. If you pin, put a reminder somewhere to review it — a tag nobody revisits is how a site ends up running a two-year-old bundle.

Allowed domains, exactly

The list is checked against the address the visitor's browser is on — the browser sets it, and a page cannot lie about it. That is what makes a publishable key safe to publish: pasted into somebody else's site, it answers nobody.

shop.example.comThat host only. A full URL such as https://shop.example.com/path is accepted too; only the host is compared.
*.example.comEvery subdomain, and example.com itself.
localhost, 127.0.0.1Not accepted on their own. To test on your own machine against the production service, add localhost (or 127.0.0.1) to the list like any other host, and take it off again when you are done. An empty list refuses everything.

CarefulRegenerating the key breaks every tag that has the old one

Settings → API Credentials → Regenerate API Key stops the current key at once. Do it if a key turns up somewhere it should not — and then update every page that embeds it, or those widgets stop answering.

One agent per page

A second script tag does not call into the copy already running — it loads the bundle again, and two widgets would mount over each other. The bundle notices and refuses the second one, with an explanation in the console.

NoteIf you want one agent to answer for several areas

Do not embed two. Make one agent an orchestrator in Settings → Team and give it the others as specialists. That is one widget and one conversation, which is what a visitor expects — see Multi-agent.

Content Security Policy

If your site sends a CSP, the widget needs the CDN for its script and the API for its requests. The handoff transport is fetched from the same host as the widget, so the one script-src entry covers both; the live handoff connection is a WebSocket, so list the API under wss: as well.

text
script-src  https://cdn.tigerbase.cloud
connect-src https://api.tigerbase.cloud wss://api.tigerbase.cloud

WarningA strict style-src blocks the widget's stylesheet

The widget writes its stylesheet into a <style> element inside its own shadow root. That keeps its CSS and yours apart in both directions, but the browser still checks the element against your policy: if your style-src does not allow 'unsafe-inline', the widget appears unstyled.