
reveal-3d
Integrates the @cognite/reveal-widget npm package into Flows apps for an interactive Cognite Reveal 3D Scene/CAD/point cloud/360-image viewer. Use when adding 3D viewer, 3D visualization, Reveal, CAD model, Point cloud model, 360 image collection, Scenes, RevealWidget, RevealWidgetController, DM 3D mapping, asset 3D model, model browser, or Cognite 3D content to a Flows application.
- Installs
- 1.9K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/cognitedata/builder-skills --skill reveal-3d- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads reveal-3d automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Reveal 3D Viewer
Add a Cognite Reveal 3D viewer to a Flows app using the published @cognite/reveal-widget npm package. Renders CAD models, point clouds, 360° image collections, and CDF scenes from CDF, with model browsing or direct model/revision IDs.
DM instance to visualize: $ARGUMENTS
Use This When
The user wants to embed an interactive Cognite Reveal viewer for CDF 3D content in a Flows app.
Do not use this skill for static diagrams, graph visualizations, or unrelated custom Three.js scenes.
Do not use the deprecated app-local "copy the bundle" approach — that pattern (a src/features/reveal-3d/ folder of copied provider/hook source) is replaced by installing @cognite/reveal-widget directly. If an app still has a copied bundle from a prior integration, migrate it to this package rather than extending it.
Prerequisites
- The app uses React + TypeScript and is wrapped in
@cognite/app-sdk'sCogniteSdkProvider(Flows auth), which supplies theCogniteClient(sdk) viauseCogniteSdk()from@cognite/app-sdk/react.@cognite/cliis the CLI used to scaffold/deploy the app, not the runtime auth library — apps created withnpx @cognite/cli apps createdepend on@cognite/app-sdkfor this, not@cognite/cliitself (theuseDune()/@cognite/dune/authhook only exists for legacy--classicscaffolds). - The CDF project has 3D models, or the user has supplied direct model/revision IDs or a CDM (
externalId/space) model reference. - For DM-linked 3D, the instance/model must be identifiable via a CDM
externalId/spacepair or a classicmodelId/revisionId; instance highlighting works once a model is loaded and the instance is contextualized (mapped) to it. - Determine whether the project's 3D content lives in the Core Data Model or the classic 3D API before setting
viewerOptions.useCoreDm— don't default it totrue. There's no single flag for this; csp-and-fixes.md gives the exact SDK calls to check directly.
Integration Workflow
Follow these steps in order. Adapt paths to the target app's conventions instead of inventing new ones.
- Inspect the target app. Read
package.json,vite.config.ts,src/main.tsx, and the app's folder/alias conventions. - Install the package and peers with the app's package manager. See Dependencies. Reuse existing pinned React and SDK versions where they satisfy the peer ranges.
- Configure Vite. Read vite-config.md and add the
three/@cognite/revealdedupe entry. No process/util/assert polyfills are needed — the package ships browser-ready. - Configure
manifest.json's CSP allowances for whatever the scene/model actually contains (scene ground-plane/skybox textures, 360° image collections). Read csp-and-fixes.md — it also covers the app-side fix point clouds need (manifest.jsoncan't grant it directly) and a StrictMode gotcha, so read it even if the app has no scenes/360 content yet. - Add a controller class that wraps
RevealWidgetControllerand drives it imperatively (load resources, style/highlight instances, control the camera) from your own event handlers — not fromuseEffectreacting to prop changes. See implementation.md. - Mount
RevealWidgetwithviewerOptions={{ sdk, useCoreDm }}(setuseCoreDmper the project, not hardcoded — see csp-and-fixes.md),setControllerRef, and the requiredappIdentifier(a string identifying the host app) inside a container with an explicit height.RevealWidgetmanages its own internal Reveal context — do not wrap it in another provider from this package. - Choose the resource pattern. Use the model-browser pattern (
sdk.models3D.list()+ classicmodelId/revisionId) as the default unless the user has already supplied a CDMexternalId/spacemodel reference. Full examples in implementation.md. - Clean up. Call
.remove()on anyReveal3DResourceHandlereturned byaddResourcewhen it's no longer needed (selection change, unmount). - Run typecheck and build (
tsc --noEmit,pnpm build, etc.) and fix any dependency/peer-version issues.
Minimal Example
import { useRef } from 'react';
import type { CogniteClient } from '@cognite/sdk';
import {
RevealWidget,
type Reveal3DResourceHandle,
type RevealWidgetController,
type ThreeDResourceIdentifier,
} from '@cognite/reveal-widget';
class ThreeDViewerController {
private model: Reveal3DResourceHandle | undefined;
constructor(private readonly widgetController: RevealWidgetController) {}
async loadModel(resource: ThreeDResourceIdentifier): Promise<void> {
this.model = await this.widgetController.addResource(resource);
this.widgetController.cameraController.focusModel(this.model);
}
dispose(): void {
this.model?.remove();
}
}
export function ViewerPage({
sdk,
resource,
}: {
sdk: CogniteClient;
resource: ThreeDResourceIdentifier;
}) {
const viewerRef = useRef<ThreeDViewerController>();
function handleWidgetController(widgetController: RevealWidgetController | undefined) {
viewerRef.current?.dispose();
if (widgetController === undefined) {
viewerRef.current = undefined;
return;
}
const viewer = new ThreeDViewerController(widgetController);
void viewer.loadModel(resource);
viewerRef.current = viewer;
}
return (
<div style={{ width: '100%', height: '70vh', position: 'relative' }}>
<RevealWidget
viewerOptions={{ sdk, useCoreDm }} // set per the project — see csp-and-fixes.md
setControllerRef={handleWidgetController}
appIdentifier="my-flows-app"
/>
</div>
);
}
Dependencies
Suggested versions are starting points. If the target app already pins compatible versions, defer to the app.
| Package | Suggested version | Purpose |
|---|---|---|
@cognite/reveal-widget | ^0.3.0 | The RevealWidget component and its types |
react / react-dom | ^18.3.1 (peer) | UI framework — peer dependency, must match the app |
@cognite/reveal | 4.36.0 | Reveal viewer runtime — exact match required. Pin to 4.36.0, not the 4.35.3 in @cognite/reveal-widget's own declared peer range — see note below. |
@cognite/sdk | ^10.14.0 (peer) | CDF API client — peer dependency |
Everything else (three, @tanstack/react-query, @base-ui/react, @floating-ui/react, @tabler/icons-react, dayjs, lodash-es, ml-matrix, random-seed, @cognite/aura, @cognite/reveal-components) is a transitive dependency of the package and installs automatically — do not add it manually unless the app needs to pin a version, or unless app code imports from it directly. The model-browser pattern in implementation.md does exactly that with @tanstack/react-query (useInfiniteQuery/useQuery) — add it as a direct dependency in that case, since importing from an undeclared transitive dependency breaks under strict package managers like pnpm.
Example install (pnpm; adapt to the app's package manager):
pnpm add @cognite/reveal-widget @cognite/reveal@4.36.0 @cognite/sdk react react-dom
@cognite/reveal-widget@0.3.0's own peer range still says @cognite/reveal@4.35.3, but its dependency @cognite/reveal-components hardcodes @cognite/reveal@4.36.0 internally. Pin the app to 4.36.0 and confirm the lockfile resolves a single @cognite/reveal version — the peer range is stale, and a real version split here (unlike a resolve.dedupe gap) breaks Reveal's shared viewer state silently.
Do not copy any source bundle into the app and do not install process, util, assert, ajv, or vite-plugin-node-polyfills for this package — none of that is needed.
Critical Rules
- Drive the widget imperatively through
RevealWidgetController, obtained viasetControllerRef. Don't try to reconstruct Reveal's old declarative provider tree (CacheProvider/RevealProvider/RevealCanvas/Reveal3DResources) — that API belongs to the old copied-bundle approach and is not what this package exposes. RevealWidgetwraps its own Reveal context internally — never nest it inside another provider from this package.- Dispose the previous controller class instance (
.dispose()calling.remove()on tracked handles) insidesetControllerRefbefore constructing a new one, and again whenwidgetControllerbecomesundefined(unmount). - Resources passed to
addResourcemust match the exact identifier shape for theirtype/sourceTypecombination (see implementation.md) — mixing classic and CDM fields is a type error. - Instance highlighting only affects instances that are already contextualized (mapped) to a loaded model; load the model first, then call
styleByInstance/focusInstances. RevealWidget's container must have an explicit height — it fills its parent.- Lazy-load canvas-heavy viewer content with
React.lazy+Suspensewhen adding a route/page. useCoreDmmust match the project, not default totrue— wrong 401s and silent 360-collection failures otherwise. Don't wrap the app inReact.StrictMode— it tears downRevealWidget's viewer mid-load in dev and produces errors that don't occur in production. Point clouds need an app-side same-origin fix, sincemanifest.jsoncan't grant thedata:CSP allowance they'd otherwise need. All three: see csp-and-fixes.md.appIdentifier(a string naming the host app) is a required prop as of@cognite/reveal-widget@0.3.0— mountingRevealWidgetwithout it is a type error. By default the widget reports anonymous usage metrics (which features are used, e.g. adding a resource, moving the camera) to a dedicatedmixpanel-browserinstance. Pass the optionaltrackingprop to change this:tracking={{ disabled: true }}to opt out entirely, ortracking={{ mixpanelToken }}to report to a different Mixpanel project instead.
Advanced Reference
For the full resource-identifier catalog (CAD, point cloud, 360 images, scenes), instance highlighting, and camera control, read implementation.md.
For Vite/dedupe configuration, read vite-config.md.
For CSP/manifest.json allowances, the useCoreDm/StrictMode gotchas, the point-cloud app-side fix, and 360-collection troubleshooting, read csp-and-fixes.md.
Verification Checklist
-
@cognite/reveal-widgetis installed alongside its peers (react,react-dom,@cognite/reveal,@cognite/sdk) at compatible versions. - The app's
@cognite/revealis pinned to4.36.0(not the stale4.35.3in@cognite/reveal-widget's peer range), with only one resolved@cognite/revealversion in the lockfile. - No source bundle was copied into the app; all imports come from
@cognite/reveal-widget, and no app code imports from@cognite/reveal-componentsdirectly. -
vite.config.tsincludesresolve.dedupe: ['three', '@cognite/reveal'](plus the app's existing dedupe entries). - No
process/util/assertpolyfills orvite-plugin-node-polyfillswere added for this package. -
RevealWidgetis mounted once, is not nested in another Reveal provider, its container has an explicit height, and it is given a requiredappIdentifierstring prop. -
viewerOptions.useCoreDmmatches whether the target project is actually Core-Data-Model-based. - The app does not wrap itself in
React.StrictMode. -
manifest.jsongrantsimg-srcforhttps://*.cognitedata.comif the app loads scenes with ground planes/skybox, andconnect-srcfor the actual signed-URL host observed from a CSP violation if it loads 360° image collections. If the app needs point cloud support, the same-originBlob-patch fix has been applied and verified. - A controller class wraps
RevealWidgetController, obtained viasetControllerRef, and drivesaddResource/styleByInstance/focusInstances/cameraControllerimperatively. - The controller class is disposed (and tracked resource handles
.remove()d) both when a new controller is set and on unmount (widgetController === undefined). - Resource identifiers use the correct
type/sourceTypeshape for the model being loaded. - Typecheck and build pass.
FAQ
What does the reveal-3d skill do?
Integrates the @cognite/reveal-widget npm package into Flows apps for an interactive Cognite Reveal 3D Scene/CAD/point cloud/360-image viewer. Use when adding 3D viewer, 3D visualization, Reveal, CAD model, Point cloud model, 360 image collection, Scenes, RevealWidget, RevealWidgetController, DM 3D mapping, asset 3D model, model browser, or Cognite 3D content to a Flows application.
How do I install reveal-3d?
Run npx skills add https://github.com/cognitedata/builder-skills --skill reveal-3d in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/reveal-3d/ (personal) or .claude/skills/reveal-3d/ (project).
Which AI agents can use reveal-3d?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is reveal-3d safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains reveal-3d?
It is published by cognitedata in cognitedata/builder-skills. It has 1,913 recorded installs.
More from cognitedata/builder-skills
skill-creator
cognitedata/builder-skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch for Claude Code or Cursor, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
code-quality
cognitedata/builder-skills
MUST be used whenever reviewing a Flows app for code quality, maintainability, or clean code issues — before a PR review, after a feature is complete, or when the user asks for a code review. Do NOT skip linting steps. Triggers: code quality, code review, clean code, refactor, maintainability, technical debt, any type, naming, dead code, duplication, DRY, single responsibility, component size, lint, linting, TypeScript strict, dependency injection, file structure.
test-coverage
cognitedata/builder-skills
MUST be used whenever fixing test coverage for a Flows app to meet the 80% line coverage hard gate. This skill finds AND fixes coverage gaps — it configures tooling, writes missing tests, covers untested paths, and refactors code for testability. It does not just report. Triggers: test coverage, fix tests, write tests, add tests, coverage fix, 80% coverage, coverage gate, missing tests, testability, vitest coverage, jest coverage.
dependencies-audit
cognitedata/builder-skills
MUST be used whenever fixing dependency issues in a Flows app. This skill finds AND fixes vulnerabilities, outdated packages, deprecated dependencies, and license issues — it does not just report them. Triggers: dependencies, packages, fix dependencies, update packages, fix vulnerabilities, npm audit fix, pnpm audit fix, CVE fix, outdated, deprecated, supply chain, license.
design
cognitedata/builder-skills
Simplified Aura guidance for selecting primitives, keeping token usage consistent, and applying reliable layout/copy/state patterns in Flows and Fusion apps.
integrate-todo-list
cognitedata/builder-skills
TodoWrite panel for an already-approved in-app useAtlasChat UI. New AI features use integrate-fusion-agent. Triggers: TodoWrite, todo panel — only when useAtlasChat already exists.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image