@cognite/dune
v3.0.0
Published
Build and deploy React apps to Cognite Data Fusion
Downloads
3,221
Readme
@cognite/dune
Build and deploy React apps to Cognite Data Fusion.
Quick start
Scaffold a new app — AI skills are pulled automatically:
npx @cognite/dune createThis prompts for your app name, org, project, and cluster, then generates a fully configured React + TypeScript project.
Authentication
New apps created with npx @cognite/dune create depend on @cognite/app-sdk — not @cognite/dune — for auth and host integration. @cognite/dune is the CLI used to scaffold, develop, and deploy the app; the generated app itself talks to the Fusion app host via @cognite/app-sdk's Comlink handshake. The template wires this up for you.
Legacy apps (--classic)
Apps created with --classic use the older Files API path and wrap their root in DuneAuthProvider from @cognite/dune/auth:
import { DuneAuthProvider, useDune } from '@cognite/dune/auth';
function App() {
const { sdk, isLoading } = useDune();
if (isLoading) return <div>Loading...</div>;
return <MyApp sdk={sdk} />;
}
export default function Root() {
return (
<DuneAuthProvider>
<App />
</DuneAuthProvider>
);
}Deployment
Deploy interactively via browser OAuth:
npx @cognite/dune deploy:interactiveFor CI, set your client secret as an environment variable and run:
pnpm deployDeployment targets are configured in app.json at the project root.
AI skills
Skills guide your AI agent (Claude Code, Cursor, etc.) through Dune-specific tasks like adding auth, building chat UIs, or reviewing code. They are pulled automatically on npx @cognite/dune create and can be synced later:
npx @cognite/dune skills pullBrowse available skills at cognitedata/dune-skills.
Requirements
- Node.js ≥ 20
- React ≥ 18 (optional peer dependency — only needed for auth components)
Maintenance
Updating the spec-kit vendor snapshot
The AI skill commands under _vendor/spec-kit/ are generated by spec-kit and checked in. To update to a new release, pass the target tag (requires uv, which provides uvx):
pnpm --filter @cognite/dune refresh-spec-kit v0.9.0The refresh script stages the generated commands, templates, and shell scripts before replacing _vendor/spec-kit/. Then review the diff under _vendor/spec-kit/ and commit it.
