Tether
DocsPricingContactGet started

Guides

The widget

One script tag and one element. A web component with its own shadow root, so it inherits nothing from your CSS and leaks nothing into it.

<script src="/tether-assistant.js"></script>

<tether-assistant
  mode="floating"
  endpoint="https://api.trytether.ge"
  publishable-key="tpk_…"
  scope-id="9"
  greeting="Hi, what would you like to find today?"></tether-assistant>

Without a developer

The console's last step (console loop O7) does all of this page for a business with a website and no engineer at hand, with nothing to type when it knows the website. A business that wants answers only can reach it straight from the preview, with Go live with your website, and connect a system later or never:

  • The origin comes from the website the visitor started with (scheme, host and port, as a browser sends them). www. and the bare domain are both offered, each a checkbox, both ticked when Tether finds the site served at both.
  • The key is the workspace's one widget key, issued when the step opens and the same every time after; it is publishable, never shown in a URL, and can be replaced under For developers.
  • The script is your Tether API's own copy, so there is no file to host.
  • One snippet carries all of it, plus a floating launcher and the first words in the business's language. Copy it, paste it once before </body>.

The step then says how to paste it on the common ways a small business runs its site, in Georgian and English: any HTML site (before </body>, or once in the shared template), WordPress (as an administrator, a Custom HTML block in the footer; no plugin, and on WordPress.com only on a plan that allows custom code), Wix (Settings → Custom code → Add custom code, All pages, Body - end; a premium plan), Tilda (an HTML code block, T123, in the footer you use on every page), Webflow (Site settings → Custom code → Footer code; a paid site plan) and Shopify (Edit code → layout/theme.liquid, before </body>). There is no plugin to install, for any of them: the snippet is the whole integration. Send to my developer mails the snippet and those steps to one address, with only the publishable key in it; Check my site reads your page and says whether the snippet is there, with this workspace's key, and where the assistant answers. The instructions open on the platform the check reads from your page (WordPress, Shopify, the site builders, or plain HTML). Copy a link for your developer makes a link, good for 30 days, that opens the same snippet and steps without a mail. How it looks picks the corner, the launcher text, the colour and the logo: the snippet carries the corner and the text, and the widget reads the colour and logo as its brand. The calls behind them are on the Embed page.

Register your page's origin first

The element calls Tether from your page, so every turn is a cross-origin request the browser preflights. Tether answers that preflight only for origins you have registered, and never with a wildcard: the request carries a key, and a wildcard would let any site that scraped it out of your HTML spend it.

curl -X PUT https://api.trytether.ge/v1/origins \
  -H "X-Api-Key: $TETHER_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "origins": ["https://shop.example", "https://www.shop.example"] }'

Scheme, host and optional port — no path, and https unless it is loopback. www.example.com and example.com are different origins to a browser, so register both if you serve from both.

A self-serve workspace registers a public site only once its signup address is confirmed: until then localhost and other local origins work and a public one answers 403 email_unconfirmed with reason public_origin. See what "live" means. With "holdUntilConfirmed": true the public ones wait instead, listed as held, and start working the moment the address is confirmed, with nothing to send again; that is what the console does, so the snippet can be copied and pasted before the email is opened (Embed).

Until this is done the element loads and every turn fails in the console with a CORS error. It is the step that is easiest to skip and hardest to diagnose from the browser's own message, which is why it is here rather than in a troubleshooting section.

Attributes

AttributeRequiredNotes
endpointyesBase URL of your Tether instance
publishable-keyyesThe full tpk_… key, tpk_ and 48 characters, as it was shown when issued. The 12-character prefix a key list shows is not a key and is refused with 401 invalid_api_key. Never a tth_… secret key — that one is a server credential
modenofloating: a launcher button fixed to the bottom-right corner (bottom-left with position="left") opens the assistant as a panel, and below 640px as a full-screen sheet. It needs no room in your layout, so put the element once in your root layout. Absent: drawn inline, 620px tall unless you set its height, in a container that gives it full width. In a flex row or narrow column an inline element shrinks to a clipped sliver
positionnoFloating mode only: left puts the launcher and the panel in the bottom-left corner. Anything else, or absent, keeps them bottom-right. Below 640px the full-screen sheet is the same either way
scope-idnoNarrows every turn to one site, store or client
customer-tokennoThe signed-in visitor, as a customer token your server minted. Also the customerToken property
upstream-tokennoThe signed-in visitor's own session token for your imported API, used when your userToken mode is prefer or require. Also the upstreamToken property. See The visitor's own API token
actionsnoPresent: the visitor may ask for an operation, and the model is offered the tenant's writes (enableWriteActions on each turn). A write it stages waits for a person the business's policy names; this element never approves it. Absent: reads only
greetingnoThe opening line
placeholdernoPlaceholder for the input
attachmentsnoimage: the visitor can attach one photo to a question. See Photos and dictation
dictationnoPresent: a microphone types what the visitor says into the input, where the browser can recognise speech
dictation-langnoThe language dictation listens for, such as ka-GE. Defaults to the element's lang, then the page's <html lang>, then the browser's

The signed-in visitor

To serve a signed-in visitor as themselves, mint a short customer token on your server after your own sign-in and hand it to the element:

<tether-assistant endpoint="…" publishable-key="tpk_…" customer-token="eyJhbGciOi…"></tether-assistant>
document.querySelector('tether-assistant').customerToken = freshToken

It travels in the X-Tether-Customer-Token header on every turn, never in the prompt. A token that is refused, for being expired, forged or another tenant's, is not ignored: the visitor is asked to sign in again, and the element dispatches tether-customer-token-refused with detail.reason so you can mint a fresh one. Without a token the visitor is anonymous.

A conversation continues only for the visitor it was opened for, so the element starts a new one when the token names a different customer, or appears or disappears (a refreshed token for the same customer keeps it), and starts a new one once if Tether answers 403 session_not_yours.

The visitor's own API token

When your API accepts only your users' own session tokens, hand the element the signed-in visitor's token, and Tether calls your imported API with it instead of the credential stored at import:

<tether-assistant endpoint="…" publishable-key="tpk_…" upstream-token="the visitor's session token"></tether-assistant>
document.querySelector('tether-assistant').upstreamToken = refreshedToken

It travels in the X-Tether-Upstream-Token header on every turn and on feedback, never in the prompt. The element reads it again for each turn, so a page that refreshes the session sets the property and nothing is remounted. Tether does not verify it or store it, and uses it only if the business switched it on with userToken (prefer uses it when present, require uses nothing else). A value Tether refuses as malformed (empty, too long, whitespace or non-ASCII) fails the turn, the visitor is asked to sign in again, and the element dispatches tether-upstream-token-refused with detail.reason. An expired token is your API's answer, not Tether's: the model says the sign-in has to be renewed.

It is not a customer token and proves nothing to Tether about who the visitor is; pass customer-token for that. The element never confirms a write, and a write approved in the inbox carries no visitor token, so under require it fails with user_token_required and nothing runs. See Calling your API as the signed-in user.

Photos and dictation

Both are off unless you ask for them, so an existing embed is unchanged.

<tether-assistant endpoint="…" publishable-key="tpk_…" attachments="image" dictation></tether-assistant>

A photo. The attach control opens a picker for one PNG, JPEG or WebP image of at most 4 MB, the same limits the API enforces. A file of another type or over the limit is turned away in the composer before it is read. An accepted one shows as a thumbnail with a remove control, and goes with the visitor's next question as imageBase64 and imageMimeType, never as a URL. If Tether still refuses it, the visitor is told why in your words rather than offered a retry. A turn that carries an image is never offered a write tool.

Dictation. The microphone uses the browser's own speech recognition and appends each phrase it is sure of to the input; the visitor reads it and presses send. What reaches Tether is the text: the element records no audio and Tether receives none. Recognition belongs to the browser, so which languages it understands, how well, and whether it sends the audio to the browser vendor's own service are the browser's matter. Where there is no recognition, as in Firefox, the microphone is not drawn. How well any language is recognised, Georgian included, has not been measured.

The four routes it calls

POST /v1/chat/stream for every turn, POST /v1/chat/feedback when a visitor rates an answer, POST /v1/chat/contact when a visitor handed to a person leaves a phone or an email, and GET /v1/chat/brand once when it mounts. Nothing else. A publishable key is scoped by the server to chat, streaming, feedback and a handoff's contact, and to reading the brand, and the widget does not go looking for the edge of that.

Maps and your own words

A places answer gets a map view only when the page sets map-tiles to a tile URL template with {z}, {x} and {y} from a provider you choose, and map-attribution to the credit line it requires. Without it the answer is a list and no tile is ever requested, because tiles load from the visitor's browser and the provider sees those requests.

Every piece of interface text, such as Call, Directions, Show all, Open until, Attach image or Dictate, can be replaced with the strings attribute, a JSON object, so the widget speaks the page's language. The keys are all, call, directions, map, list, showAll, showLess, places, openUntil, opensAt, opensOn, closed, copy, copied, askAgain, helpful, notHelpful, thanks, whatWentWrong, send, previous, next, zoomIn, zoomOut, attachImage, removeImage, imageType, imageTooLarge, imageRefused, dictate, stopDictation, micBlocked and dictationFailed, and for a handoff's contact fields contactTitle, contactPhone, contactEmail, contactSend, contactSent, contactInvalid, contactPhoneInvalid, contactEmailInvalid, contactFailed, contactClosed and contactLimit; {n}, {time}, {day} and {max} are filled in.

Staged writes are shown, never approved here

With the actions attribute set, a turn that stages a write comes back with the preview and the message that it is waiting:

AWAITING APPROVAL
Cancel the 15:00 follow-up with Dr Reyes on Friday
cancel_appointment
Waiting for someone who can approve it.

There is no approve control. The widget runs in a page whose visitor is not authenticated to your tenant, so there is no identity to attribute an approval to. Approval happens in the inbox, or in your own UI.

A handoff is shown as yours

When a turn is handed to a person, the widget shows your contact message once, in its own panel below the answer, with the lang the message was chosen for. It is your words, not the model's, so it is rendered as plain escaped text.

When the answer says offerContact: true, which it does for a visitor nobody identified when the handoff reaches someone at your business, the panel also offers two optional fields, a phone and an email, in the handoff's language (Georgian, Georgian typed in Latin letters, Russian or English; the strings attribute overrides them). The widget checks them as the server does and posts them with the conversation's id to POST /v1/chat/contact; your people see them in the handoff mail and in the inbox. Nothing is required, and a signed-in visitor is never asked, because you already know who they are. An accepted contact raises tether-contact with { sessionId }.

The element also raises tether-handoff, with { trigger, message, language, offerContact } as its detail, so your page can open its own contact channel:

document.querySelector('tether-assistant')
  .addEventListener('tether-handoff', (e) => openLiveChat(e.detail))

tether-answer carries the same object as detail.handoff, or null.

After a handoff the element checks GET /v1/chat/live every few seconds while it is open, so a person at your business can reply in the chat. When one does, the element notes that they joined, by their display name, and shows each reply apart from the assistant's answers as plain escaped text; it raises tether-live with { staff } once and tether-staff-message with each reply. While the chat is live, what the visitor sends goes to that person, and the element raises tether-live-sent instead of rendering an answer. When the handoff is marked handled, it notes that the conversation with the team has ended and stops checking.

Escaping

Every string that reaches the DOM is escaped. Block content is model output derived from a stranger's question and your data; it is never trusted markup. Markdown support is a deliberate subset — bold, inline code, line breaks — with no links, because a link in model output is an open redirect a visitor will click.

Theme

Brand tokens as CSS custom properties. Override any of them on the host:

tether-assistant {
  --tether-ink: #171717;
  --tether-surface: #F3F0E9;
  --tether-accent: #E9784A;
  --tether-radius: 10px;
  --tether-font: Inter, system-ui, sans-serif;
}

Under those, the widget wears your workspace's brand: the colour and logo Tether read from your site in the website preview, or what the dashboard's Assistant settings set instead (the widget's brand). A token you set on the page wins over it, so a page that already themes the element keeps its own accent.

All nine block types render, including cards and places. A cards block with a total is headed "8 of 1,546", with a See all link when it has more.url; a card with a url gets a View button. Tapping a card opens a detail sheet inside the element: its pictures, title, brand, price with the crossed-out was and the reduction, description, attributes, and Open on the site. The sheet keeps focus inside it and closes on Escape or a tap outside. Every link is https only and opens in a new tab with rel="noopener noreferrer". When GET /v1/chat/brand carries start, the empty chat shows its featured items (each opens the sheet) and chips for reduced items, categories and brands that ask a question. On sale leads the categories line, and each line of chips scrolls sideways rather than wrapping, so the picks fit a 720px panel. Categories in the visitor's script come first; when the shop has none, its own names are offered. Of brands that share a name (CALVIN KLEIN and CALVIN KLEIN JEANS) one chip is kept. A card or featured item whose title is only its brand, or has no letters, shows its category as the name with the brand above it. An attribute labelled variants is shown as "Versions", with "2 versions" for a bare count or the differences when they are named. A card, more or featured item that carries alternates (a map of language to an https address on the same site, or a list of { lang, url }) links to the page in the widget's language, and to its own url otherwise. After an answer the log scrolls so the end of the answer shows above the composer, unless the visitor scrolled away while it was coming; a line above the composer shows while more of the log is below. The strings shownOf, seeAll, view, openOnSite, itemDetails, closeDetails, imageN, startPicks, startCategories, startBrands, onSale, askCategory, askBrand, askDiscounted, variants, versionsOne, versionsFew and versionsMany are in English, Georgian, transliterated Georgian and Russian, and can be renamed with strings like the others, with {shown}, {total}, {title}, {n}, {name} and {count} filled in. Under every answer the visitor can copy it, ask again, and rate it.

A card for a price read from the website says it the way the site does: "from 60 ₾" ("60 ₾-დან", "от 60 ₾"), "50–60 ₾", "up to 80 ₾", "≈ 40 ₾", "Price on request" or "Free", with the unit after it ("per month"), a duration chip with a clock, and the variant under the name. Below it a link line names the source ("From: Lashes", or "Price list (PDF), p. 3", opening that page of the document), a collapsed "As written" line holds the quoted text (open when the reading is less than 0.8 sure), a note gives the other price when the site lists the service twice ("Also listed as 90 ₾ on Price list (PDF), p. 2"), and a badge asks the visitor to check a price read from a scan. Such an answer never says prices are unavailable; its note says the prices are as published on the site and when they were read. When the answer carries meta.sourceDetails, its sources are listed under it, a document as "prices.pdf · p. 4", a page by its title, and any other listed address as it is. A shop's cards are unchanged, except that a card whose price carries a unit (a rental's daily rate) shows it after the price: "80 ₾ per day". The strings priceFrom, priceUpTo, priceRange, priceApprox, priceOnRequest, priceFree, perUnit.hour (and perUnit. with session, visit, month, lesson, course, m2, kg, piece, person, portion, litre, tooth, installment, day, night, week), minutes, fromSource, pdfPage, pdfDocument, alsoListed, asWritten, scannedCheck, pricesRead, sources and sourcePage are in the same four languages and can be renamed the same way, with {price}, {min}, {max}, {n}, {title}, {page}, {source}, {time} and {name} filled in. A type this build does not know is skipped rather than guessed at. An answer flagged preview (meta.preview, or preview on a block) carries a note under it saying live stock, orders and prices are unavailable until a system is connected. Only the anonymous preview sandbox's answers are flagged. A workspace live on its website alone answers without the note: its answers say for themselves what the website cannot show, and name their pages in meta.websiteSources.