Flows (Documentation Index
Fetch the complete documentation index at: https://docs.cognite.com/llms.txt
Use this file to discover all available pages before exploring further.
@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: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. CallconnectToHostApp() 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 viafusionOpenPlugin. 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:Testing
Generated custom apps include Vitest and React Testing Library. From your app directory, run: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:
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 fromconnectToHostApp():
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
- Get started with Flows — Create a project and run it in CDF.
- Run your app locally — Dev server, HTTPS, and troubleshooting.
- Deploy your Flows app — Interactive deploy, CI/CD, and data sets.