Skip to main content
AiqlProvider is a pure context container. It does not fetch tokens. Pass a token from useToken or mint one yourself, then wrap the components that need it.

Import

Usage

Basic

Theme

theme defaults to "auto", which follows the user’s prefers-color-scheme.

Multiple embeds

One provider can wrap several components that share the same workspace token:

Artifact open events

When a user clicks an artifact card inside an embed (for example a canvas, dashboard, or presentation preview in Chat), the iframe posts an ARTIFACT_OPEN message to the parent. The SDK turns that into an onArtifactOpen callback so your host can navigate to its own routes instead of opening AiQL in a new tab. Register the handler once on the provider so every embed under it receives it:
You can also pass onArtifactOpen on Chat or Frame. A prop on the component overrides the provider handler for that iframe only. See useEmbedNavigator for the postMessage shapes (ARTIFACT_OPEN, EMBED_READY, NAVIGATE, and related constants).

API Reference

AiqlProvider props

ArtifactOpenEvent