/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://onlocalhost,127.0.0.1and.localhostnames 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
modeisview(the default) orinteract. 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.originsdefaults to the whole list from step 1; each must be on it (400origin_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 hearsawayandback.- A mint isn’t kept under an
Idempotency-Key(its answer holds the token): each call mints a new embed. expires_inis 30 to 86400 seconds, 900 by default. The embed opens until then, and a view still open at that moment ends too.tokenandurlcome in this answer only. Mint one per page load, on your server, and put theurlstraight 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
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 oftabs, and on the embed’ssiteswhen it has some).{ type: 'state' }answers withreadyagain, for a page that started listening late.
Security
- The token is the credential. Treat it like a short-lived session: mint it per view, keep
expires_inshort, and revoke it when your page closes the view. frame-ancestorsstops 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).