Welcome! This SDK allows you to integrate your JavaScript and WebXR Applications with Cognitive3D, which provides analytics and insights about your VR/AR/MR project. In addition, Cognitive3D empowers you to take actions that will improve users' engagement with your experience.
Node.js version 20 or higher. To check your current version:
node --version
You can add Cognitive3D to your JavaScript project in two ways.
Inside your JavaScript project's terminal, run the following command
npm install @cognitive3d/analytics
If you want the entire source code, whether that be to run tests, make modifications, you can clone this repository by
git clone https://github.com/CognitiveVR/c3d-sdk-webxr.git
cd c3d-sdk-webxrnpm installThis will transpile the SDK src files into a /lib folder
npm run buildNavigate to your projects directory, and then run the following command
npm install /pathTo/c3d-sdk-webxrHere's an overview of the key files and directories in the project:
c3d-sdk-webxr/
├── src/ # Contains the source code for the SDK.
├── adapters/ # Modules for integrating with Three.js, Babylon.js, PlayCanvas, etc.
└── utils/ # Utility modules for framerate tracking, HMD orientation, etc.
├── __tests__/ # Contains all the Jest tests for the SDK.
├── assets/ # Contains images and logos used in the readme.
├── lib/ # Generated by the build process, contains the transpiled SDK files (UMD, ESM, CJS).
└── settings.js # Configuration file for the SDK tests (API key, scene info).
The SDK is flexible and integrates seamlessly with various JavaScript frameworks and web engines such as ThreeJS, Wonderland Engine, PlayCanvas, and more.
It supports a wide range of development environments by providing multiple module formats in the /lib folder:
- UMD: Universal format for direct use in browsers via a <script> tag.
- ES Module: Modern module standard, used by most bundlers and modern Node.js.
- CommonJS: Compatible with older Node.js environments.
The Cognitive3D WebXR SDK documentation explains how to integrate the SDK, track user experiences, export scenes, track dynamic objects, and more.
For more detailed examples and complete project integrations (Playcanvas, ThreeJS, Wonderland Engine), please see our sample applications repository
