Add a support widget to your website

Paste one line and your website gets a "Get help" button that shares the visitor's tab with your support team, configured from your GaiaDesk account, not in code.

Embed
Preview of the card
<a href="https://gaiadesk.net/docs/website-widget"><img src="https://gaiadesk.net/docs/_api/public/orgs/89a5df38-be2c-4963-8823-21d4bd40a2ab/spaces/57b99ea0-d45a-4986-8aa6-6b0683c9fe1d/pages/31dfdcf5-64dc-4b29-a1dd-01599039b217/social-card.svg?v=3e7ae33eec8b" alt="Add a support widget to your website" width="600" height="315"></a>

Paste one line into your website and every page gets a "Get help" button. A visitor who clicks it and agrees shares that browser tab with your support team, who see it in the GaiaDesk console and, if you allow it, guide it. Your visitor installs nothing, and you write no code: the widget's name, colours, wording and behaviour are set on your GaiaDesk account page.

The widget is built on GaiaDesk's open-source web SDK, @gaiadesk/embed. If you would rather put the button in your own app's interface, use the SDK directly: see in-app support for web apps, and in-app support for every platform.

What your visitor sees

  • A launcher. A "Get help" button in a corner of the page, in your colour.

  • A panel. Clicking it opens a small card with your logo and name, your greeting, what will and won't be shared, and a Share this tab button.

  • A consent dialog and the browser's own prompt. The dialog names your company and says what your team will be able to do. Then the browser asks which tab to share; your visitor picks this one. Nothing is shared before both.

  • A support code. While they wait for an agent, the panel shows a nine-digit code, large and easy to read out, with a Copy button.

  • A bar for as long as anything is shared. "Sharing with Acme support · Stop", at the bottom of the page. When an agent joins, the panel says "Connected to Acme support" and offers Stop sharing.

When sharing stops — your visitor presses Stop, closes the tab, or the session expires — the panel goes back to its start and says why.

1. Get a publishable key

On your GaiaDesk account page, open Settings → AI agents & API → API keys, choose Create API key…, tick Publishable key and list your website's origins, for example https://www.example.com https://shop.example.com.

A publishable key is safe to put in a web page: it can only create support sessions, and only from the origins you listed. A page on any other origin gets nothing, so register every origin the widget will run on (each subdomain counts separately).

The key (pk_live_…) is shown once, when you create it, together with the line to paste. Copy it then.

2. Paste the line

Put this before </body> on every page that should offer help, with your key:

<script src="https://gaiadesk.net/widget.js" data-key="pk_live_…" async></script>

That's the whole installation. The script loads in the background, asks GaiaDesk for your widget's settings, and draws the launcher. If the settings can't be loaded (the page's origin isn't registered on the key, or the key was revoked), or the widget is turned off, it draws nothing and says why once in the browser console. Including the line twice is harmless.

3. Make it yours

Under the key in API keys, open Website widget. Everything you change shows at once in a live preview, drawn by the widget itself; Save to publish it. Sites pick up a change within a minute.

Setting

Show the widget

Off: the script loads but shows nothing.

Company name

"Sharing with Acme support". Up to 60 characters. Empty: your site's address.

Brand colour, text colour

The launcher, buttons and bar. If the text colour is hard to read on the brand colour, the widget uses white or near-black instead.

Logo URL

An https:// image, square works best. Empty: the first letter of your name.

Button label

The launcher's text, 1 to 40 characters. Default "Get help".

Greeting

A sentence at the top of the panel, up to 200 characters.

Position

Bottom right or bottom left.

What your team may do

View only: your team sees the tab but can't click or type in it. Co-browse: they can also point, scroll, click and type inside the page to guide your visitor, who sees everything and can pause it at any time.

Hide on these paths

Up to 20 paths, one per line, each starting with /. The launcher is hidden on any page whose path starts with one, for example /checkout. A session already running keeps its launcher.

Reset to defaults puts every setting back.

Keeping things private

Only this browser tab is ever shared — never other tabs, windows or apps; if your visitor picks a window or their whole screen, sharing stops at once.

Password fields, and inputs whose autocomplete is current-password, new-password, one-time-code, cc-number or cc-csc, are hidden from your team automatically. Mark anything else sensitive with data-gaiadesk-mask; everything inside it is hidden too:

<div data-gaiadesk-mask>Account balance: $12,345.67</div>

Masked areas are painted over in every frame before it leaves the page. In a co-browse session your team can't type into or click a masked element.

Tell your team who's asking

If your visitor is signed in, pass who they are, and your agents see it next to the waiting session. Either set it before the script loads:

<script>
  window.gaiadeskSettings = { customer: { name: "Ada Lovelace", plan: "pro", id: 4182 } };
</script>
<script src="https://gaiadesk.net/widget.js" data-key="pk_live_…" async></script>

or call identify at any time before your visitor shares:

GaiaDeskWidget.identify({ name: "Ada Lovelace", email: "ada@example.com", plan: "pro" });

A customer is a flat object of at most 16 fields: names of letters, digits, _, - or ., and values that are strings (up to 200 characters), numbers or booleans. Anything else is ignored, with a console warning. (On a static site, put gaiadeskSettings in a script file rather than inline if your CSP forbids inline scripts.) Your agents see these details as your page's word: the console marks them as unverified.

Use your own button

To open the panel from your own "Help" link instead of the floating launcher, turn the launcher off and either name your button:

<a href="/help" class="help-link">Help</a>
<script src="https://gaiadesk.net/widget.js" data-key="pk_live_…"
        data-launcher="false" data-open-on=".help-link" async></script>

data-open-on is a CSS selector: a click on anything that matches it opens the panel (and doesn't follow the link). Or open it from your own code:

document.querySelector("#help").addEventListener("click", () => GaiaDeskWidget.open());

GaiaDeskWidget has:

open(), close()

Show or hide the panel. open() before the widget has loaded opens it as soon as it has.

stop()

Stop sharing now.

identify(customer)

Who the visitor is (above).

on(event, fn)

Listen to an event; returns a function that stops listening.

Events

GaiaDeskWidget.on("ready", ({ joinCode }) => analytics.track("support_code_shown"));
GaiaDeskWidget.on("ended", ({ reason }) => console.log("support ended:", reason));

Event

Detail

ready

{ joinCode }: sharing has started; the nine-digit support code.

joined

{ agent }: an agent is watching (their email, when known).

ended

{ reason }: stopped, declined, expired, disconnected or error.

error

{ code, message }: why sharing didn't start or broke off.

Phones and tablets

Phone and tablet browsers can't share a tab. There the panel says that screen sharing needs a computer, and suggests opening the page in Chrome, Edge or Firefox on one, instead of offering the button. Co-browsing needs a Chromium-based browser (Chrome, Edge, …); in other desktop browsers your team can still see the tab.

Sites with a Content Security Policy

If your site sends a Content-Security-Policy, allow the widget's script and the addresses it talks to:

script-src  https://gaiadesk.net;
connect-src https://api.gaiadesk.net https://gaiadesk.net wss://gaiadesk.net;
img-src     https://<your logo's host>;

api.gaiadesk.net serves the widget's settings; gaiadesk.net creates the session and carries its signalling. The video itself goes over WebRTC (through GaiaDesk's relay when a direct path fails), which connect-src doesn't govern. The widget's own styles never need 'unsafe-inline'. The consent dialog and the sharing bar currently do: with a style-src that leaves it out, they appear unstyled.

What is and is not permitted

You may: put the widget on your own websites; offer support sessions to your own visitors; brand it with your name, colours and logo; open it from your own buttons.

You may not: hide or imitate the consent dialog or the sharing bar; start a session without your visitor's agreement; use it to watch visitors who haven't asked for help.

The support sessions it creates follow the same rules as any other: see the support API reference.

Updated