Skip to main content
Solved

Working with cdf demo project

  • May 3, 2025
  • 28 replies
  • 327 views

Show first post

28 replies

  • Author
  • Committed
  • August 29, 2025

Hi, in Cognite 3D Viewer I need to integrate it into my app.

We already have the model ID and revision ID. I went through the Cognite 3D Viewer documentation, and from what I understood, the code looks like this:

 

import { CogniteClient } from '@cognite/sdk'; import { Cognite3DViewer } from '@cognite/reveal'; const loginManager = new LoginManager('publicdata', 'api'); const client = new CogniteClient({ appId: 'myCadAppId', project: loginManager.project, getToken: async () => loginManager.getToken() }); await client.authenticate();

But my question is about initialization in a React app.
Since we already have authentication credentials for public data in our backend (using the Python SDK), do we need to create another secret/API key for the JavaScript side in an OIDC widget, or can we reuse the backend authentication flow to render the 3D model in React?


  • Author
  • Committed
  • August 29, 2025

Hi ​@Mithila Jayalath  in Cognite 3D Viewer I need to integrate it into my app.

We already have the model ID and revision ID. I went through the Cognite 3D Viewer documentation, and from what I understood, the code looks like this:

 

import { CogniteClient } from '@cognite/sdk'; import { Cognite3DViewer } from '@cognite/reveal'; const loginManager = new LoginManager('publicdata', 'api'); const client = new CogniteClient({ appId: 'myCadAppId', project: loginManager.project, getToken: async () => loginManager.getToken() }); await client.authenticate();

But my question is about initialization in a React app.
Since we already have authentication credentials for public data in our backend (using the Python SDK), do we need to create another secret/API key for the JavaScript side in an OIDC widget, or can we reuse the backend authentication flow to render the 3D model in React?


  • Author
  • Committed
  • August 29, 2025

Hi ​@Mithila Jayalath , 

 

Yeah I got an access to 3d viewer using my python sdk authenticated access token