Skip to main content
Interaction methods available on the HostAppAPI instance returned by connectToHostApp. Use these to navigate within or outside of Cognite Data Fusion (CDF), persist shareable app state, hide or show the CDF sidebar (the shell), and integrate with the AI agent panel. For connecting and getting credentials, see Auth API.

Prerequisites

Navigates to a path within CDF.
Opens an external URL.

State

syncInternalState

Saves a serialized state string to the customAppInternalState URL search param. The saved state is passed back as initialState the next time the app mounts. Users can return to the same view after navigating away or refreshing. Because the state lives in the URL, the link is shareable.
See App state in URLs for a full guide covering state restoration, what to include in persisted state, and a complete example.

Layout

setHideShell

Hides or reveals the CDF sidebar for the current page, maximizing your app on the page.
setHideShell only takes effect when your app is loaded on a custom apps route (/custom-apps/…). Calling it from any other route is a no-op for sidebar visibility. Requires @cognite/app-sdk 0.9.0 or later.

Example: maximize your app on the page

Fullscreen

Flows custom apps run inside a browser iframe that has the fullscreen feature policy enabled. This means your app can request the browser’s native fullscreen mode using the standard Fullscreen API; no additional configuration required.
Use setHideShell in Layout when you want to hide the CDF sidebar and maximize your app within the page. Use the browser Fullscreen API when you need to take over the entire display (for example, for a media viewer or a 3D scene).

Agent

Control the CDF AI agent panel and unregister an agent server from your app. For parameters, examples, and the full workflow (registering a server, resources, and actions), see Integrating AI agents with Flows.

sendAgentLayoutMode

Changes the visibility or layout of the agent panel (sidebar, fullscreen, or closed).

sendAgentMessage

Injects text into the agent chat. Optionally starts a fresh session. Open the panel with sendAgentLayoutMode first so the user sees the message.

unregisterAgentServer

Unregisters an agent server previously registered with registerAgentServer from @cognite/app-sdk. Call this when your app unmounts.

Further reading

Last modified on August 5, 2026