App Console SDK v2

The flowgear-webapp package connects an embedded Flowgear App to its Console host. Use it to initialize Console theme support, read the current App context, invoke Workflow-backed endpoints, display Console feedback, and synchronize App navigation.

The SDK methods work when the App is embedded in the Flowgear Console. They exchange asynchronous messages with the parent Console and do not provide direct access to Connection values, API-key credentials, or other protected platform data.

The easiest way to get started with an app is to use a sample app, see Apps.

The flowgear-webapp README on npm is the complete SDK reference. It covers every method's signature, parameters, return values and examples, the InvokeError type and Console error codes, cross-Tenant calls and styling.

Install and initialize

The downloadable sample App already includes flowgear-webapp. To add it to an existing project, run:

npm install flowgear-webapp

Import Flowgear, then initialize the SDK once before rendering the App:

import { Flowgear } from "flowgear-webapp";

await Flowgear.Sdk.init();

init() reads the Console theme and applies it to the document body. The body receives a data-theme attribute with the Console theme identifier and either the theme-light or theme-dark class.

Run the App over HTTPS and inside the Console. When it runs as a top-level page, the SDK logs development guidance but cannot complete host requests, and its promises never settle.

Method summary

Method Purpose
init() Initializes the embedded connection and applies Console theme attributes.
getContext() Returns the current Tenant, Site, user, Account, theme, and Environment context.
invoke<T>() Invokes a published Workflow endpoint through the Console under the signed-in user's session and returns its typed response.
setAlert() Displays a Console alert.
confirmModal() Opens a Console confirmation dialog.
getTextModal() Opens a Console text-entry dialog.
openUrl() Opens a Console-relative or external URL.
setParentPath() Synchronizes a safe in-App route with the parent Console URL.

Use invoke() for every backend call in an embedded App. Do not call embedded Workflow endpoints directly with fetch or axios. Use the generated openapi.yml to discover methods, paths, payloads, and responses.

Security boundaries

The SDK provides a controlled bridge to the Console; it does not make browser code trusted. Treat the App context as environment and presentation information, not authorization. Validate all input again in the backing Workflow, keep secrets in server-side Connections, and scope Cookie-based Keys to the minimum users and Workflows.

See also

See the flowgear-webapp package on npm for the complete SDK reference, and App security model, Flowgear Apps, and Build an App with an agent for the surrounding architecture and delivery process.