{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "ggoggam-vitre--bridge-with-own-hybrid-page",
 "repo": "ggoggam/vitre",
 "repo_url": "https://github.com/ggoggam/vitre",
 "repo_slug": "ggoggam-vitre",
 "title": "Exchange typed messages with a page you own",
 "page_title": "How to exchange typed messages with a page you own with Vitre",
 "summary": "Send and await postMessage payloads between the workflow and your hybrid web page.",
 "who": "A mobile developer who ships a checkout or form page inside the app and wants the native side to react to it.",
 "problem": "Messages sent from a page handler can be lost when the native side starts waiting after they arrive.",
 "outcome": "A workflow that clicks a button, receives a typed payload through awaitMessage, and posts an acknowledgement back into the page.",
 "steps": [
  "Add vitre-core to commonMain dependencies.",
  "Define @Serializable payload classes for the messages you send and receive.",
  "Load your page with loadHtml or navigate, then waitFor and click the target element.",
  "Add awaitMessage with a type and a timeoutMs, then postMessage with an id and typed payload.",
  "On Completed, call event.decodePayload for the awaited variable."
 ],
 "agent_prompt": "In <project-path>, write a Vitre workflow that loads <page-html>, clicks <button-selector>, awaits a payload of type <message-type>, and posts an acknowledgement back. Expected output: the decoded payload in the Completed event. Verify that the message is received even when the page posts it synchronously on click.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README says click dispatches a synthetic DOM click that does not prove the site's operation completed, so verify results with waitFor, extraction, or the bridge acknowledgement.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "kotlin",
 "requirements": [
  "Kotlin 2.3.10 Multiplatform project (Android minSdk 24, iOS 15.0+, or desktop with JetBrains Runtime and JCEF 21)",
  "Maven Central access, which is the only setup needed for the published artifacts",
  "Compose Multiplatform if you want the optional vitre-compose UI layer"
 ],
 "risk": "dual-use",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/ggoggam-vitre/bridge-with-own-hybrid-page/",
 "md": "https://dedupedai.com/use-cases/ggoggam-vitre/bridge-with-own-hybrid-page/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/ggoggam-vitre--bridge-with-own-hybrid-page.json",
 "api_version": "v1"
}
