Installation
The library has peer-dependencies on Cognite Data Fusion JS-SDK and ThreeJS which must be installed as dependencies in the client application that uses Reveal.
- npm
- Yarn
- pnpm
npm install @cognite/reveal @cognite/sdk three@<version>
yarn add @cognite/reveal @cognite/sdk three@<version>
pnpm add @cognite/reveal @cognite/sdk three@<version>
Please find the correct version of ThreeJS in the release documentation on Github. We only guarantee support for the exact ThreeJS version specified there.
Installation for projects with Content-Security-Policy
To be able to use Reveal while having a CSP you have to allow the following:
- script-src
unsafe-eval
- connect-src
data:
These settings are nessesary to allow for execution of internal WebAssembly modules bundled with Reveal.
The connect-src
policy is for allowing the WebAssembly module to be added as data url.
The unsafe-eval
policy is needed to evaluate and execute the WebAssembly module at runtime.
This may be removed in the future once the wasm-unsafe-eval policy gets implemented into all major browsers.
Evaluate security risks before adding any of these options to your CSP.