Skip to main content
Flows (@cognite/cli) is a CLI for building production-ready React apps that run inside CDF. You get project scaffolding, authenticated access to the Cognite SDK, a Vite-based dev workflow, and paths to deploy without assembling those pieces yourself. For a hands-on path from install to first run, see Get started with Flows.

Scaffolding

You create a full app layout, configuration, and recommended tooling with a single command:
The generator captures org, project, and cluster in app.json and sets up Cursor rules when you use Cursor as your editor. See Get started with Flows for prompts and folder layout.

Authentication in CDF

Flows integrates with CDF sign-in when your app runs in the CDF iframe. Call connectToHostApp() from @cognite/app-sdk to get a HostAppAPI instance, then use getProject(), getBaseUrl(), and getAccessToken() to construct an authenticated CogniteClient. See the Flows Auth API for props, loading and error, and return values.

Local development with Vite

Templates use Vite with hot module replacement (HMR), HTTPS on localhost (locally trusted certificates), and optional auto-open in CDF via fusionOpenPlugin. With auto-open, you run the dev build inside the CDF iframe and hit the same sign-in flow and URLs you get when the app is published. See Run your app locally and the Vite plugin API.

Build and deploy

Deploy to CDF directly:
Preview deployments for pull requests:
For interactive deploy and CI/CD, see Deploy your Flows app.

Testing

Generated custom apps include Vitest and React Testing Library. From your app directory, run:
Script names are defined in package.json.

Code quality

The template ships with ESLint configuration (eslint.config.mjs) and npm scripts for linting and formatting. From your app directory, run:
Script names are defined in package.json.

Data fetching with TanStack Query

TanStack Query (React Query) is included so you can pair cached, declarative data loading with an authenticated SDK from connectToHostApp():

TypeScript

Apps are TypeScript-first, with strict settings suited to app development. Types from @cognite/sdk (for example, resources such as assets) work with your components and hooks as you build out the UI.

Further reading

Last modified on June 19, 2026