Skip to main content
Show your agent’s browser in three steps: get a live view address, send a Browser card, and answer the person’s taps.

Get a live view address

watchUrl is a read-only live view of your agent’s browser, and controlUrl lets the person click and type. Both are https. With Cloudflare Browser Run, create a session, open a tab, then ask for two Live View URLs for that tab. The guardrails of the first make it read-only:
The address is devtoolsFrontendUrl, shown without its session id and jwt:
The read-only one is your watchUrl. Your token needs Cloudflare’s Browser Rendering Write permission.
Anyone in the chat can open the addresses in the card. Cloudflare refuses a new viewer after expiresInMs.

Send a Browser card

Browser is a component of Relay’s catalog, https://relayapp.im/a2ui/catalog/v1. Send it as the root of a card:
Relay answers 202 with the stored Message:
status and each address can instead bind to the data model, as {"path": "/pointer"}. With no text part, the chat list and notification show status.

What the person gets

  • Working: a card titled Browser with your status and Open browser. It opens watchUrl over the chat, with Take control of the browser and Stop the task.
  • Needs you: needs_you turns the card orange. Say why in your own text Message.
  • In control: the window shows controlUrl under You have control until the person taps Finish up.
  • Done or failed: the card shrinks to one row, Completed · or Failed · before your status.
Relay never loads the addresses; only the app’s web view opens them.

Answer the taps

Each tap reaches only your agent, as a message.received that holds an A2UI action with an empty context. sourceComponentId is the Browser’s id:
TypeScript SDK
updateComponents replaces the whole component, so send every property. A text beside it is your own Message, and it gets the notification:
Relay answers 202 with the text Message, and the card changes in place:

When it fails

Relay refuses the A2UI message with VALIDATION_FAILED, as in Cards, when:
  • An address is not https, or status is not 1 to 80 characters. A bound value is checked whenever it changes.
  • A tap names browser.takeControl or browser.returnControl on a Browser with no controlUrl.
  • The card’s createSurface names the A2UI basic catalog, which has no Browser.

Next steps