Skip to main content
Your support page, or your end user’s own page in your app, can show a browser’s live view in an iframe. Your backend mints an embed for one browser over /v1, and the iframe opens its url. Nothing else of Hotkey’s can be framed by another site: the console and hand links keep frame-ancestors 'self'.

1. List the sites that may frame your browsers

  • Each entry is an origin: https://, a host and maybe a port, nothing after it. No wildcards. http:// on localhost, 127.0.0.1 and .localhost names only on a hub that itself runs on one (yours, while you develop). At most 10.
  • In a team, only owners and admins change the list.
  • Taking an origin off the list ends every embed that could only be framed from it, and closes its open views.

2. Mint an embed for one browser

  • mode is view (the default) or interact. A view shows the page live and takes no input: clicks, keys, the address and pastes are dropped by the server, whatever the page sends. Interactive takes the input a hand link’s guest may give (the mouse, the keyboard, files from the device), in any of the browser’s tabs, and its person can answer the browser’s asks with Done or Can’t do it.
  • origins defaults to the whole list from step 1; each must be on it (400 origin_not_allowed).
  • sites, up to three, keeps the embed to tabs on those sites and the asks of those tabs. An interactive one can’t leave them: a link to another site is refused, as on a hand link, and a page that leaves them anyway ends the view. A view locks nothing: when its tab goes to another site (your agent navigates), its picture stops until the tab is back, and your page hears away and back.
  • A mint isn’t kept under an Idempotency-Key (its answer holds the token): each call mints a new embed.
  • expires_in is 30 to 86400 seconds, 900 by default. The embed opens until then, and a view still open at that moment ends too.
  • token and url come in this answer only. Mint one per page load, on your server, and put the url straight into the iframe. Don’t log it or send it to anyone else: whoever has it sees, or drives, that browser until it ends.
  • A browser has at most 50 live embeds (409 embed_limit).
GET /v1/browsers/{id}/embeds lists a browser’s embeds, GET /v1/embeds/{id} reads one, and DELETE /v1/embeds/{id} revokes it: its open view ends at once. An embed also ends when its browser is deleted or moved to another workspace.

3. Frame it

The page answers with Content-Security-Policy: frame-ancestors set to the embed’s origins, so a page of any other site gets a refused frame. It asks for no camera, microphone or location, and sends no Referer. What the embed never shows: the browser’s clipboard, its saved sign-ins and passkeys, its downloads, the address bar, and the links of its asks. One person watches a browser at a time. An embed that opens takes the browser from another embed, which then says it is open elsewhere. It never takes it from someone signed in (your staff in the console) or from someone doing an ask through a hand link: it waits, says so, and tries again every 5 seconds. A view never gets the live page mode, which sends the page’s DOM.

4. Hear what happens

The frame posts { hotkey: { type, … } } messages to your page:
A tab is { id, title, url }. The id is the live view’s own, not an agent’s tab number. Your page may send two messages to the frame, with hotkey.contentWindow.postMessage({ hotkey: … }, 'https://console.hotkey.so'):
  • { type: 'switch', tab: '<id>' } shows that tab (one of tabs, and on the embed’s sites when it has some).
  • { type: 'state' } answers with ready again, for a page that started listening late.
The frame takes them only from its parent, and only from one of the embed’s origins.

Security

  • The token is the credential. Treat it like a short-lived session: mint it per view, keep expires_in short, and revoke it when your page closes the view.
  • frame-ancestors stops another site from framing the view. It doesn’t stop someone who has the token from opening it in a tab of their own, which is why the token is short-lived and only in your page.
  • Asks raised while an embed watches show in it without their link. To give someone a step, send the ask’s link yourself (POST /v1/asks).