Skip to main content
useEmbedNavigator is the low-level host ↔ iframe bridge used by Frame. Most apps should set onArtifactOpen on AiqlProvider instead of calling this hook directly. Use it when you build a custom iframe wrapper and need to:
  • Drive in-iframe navigation (NAVIGATE / PREFETCH)
  • Wait for EMBED_READY, then send a chat message (SEND_MESSAGE)
  • Handle ARTIFACT_OPEN from artifact cards inside the embed
For Chat, Brainstorm, and Analyze, prefer onReady and ref.sendMessage on Chat, Canvas, or Dashboard. Call sendMessage after onReady. The embed keeps the text until its chat can send, then starts the run.

Import

Message protocol

All messages use window.postMessage. The host validates event.origin and event.source against the iframe.

Host → iframe

Outbound messages are queued until the iframe announces ready.

Iframe → host

EMBED_MESSAGE exports the string constants for these types.

ARTIFACT_OPEN payload

Inside /embed/*, artifact open links call preventDefault and post this message instead of navigating. Outside embed mode they still open in a new tab.

Usage

API Reference

Parameters

Return value

ArtifactOpenEvent

See AiqlProvider for the recommended host integration.