The Vircadia Web SDK (codename Ananke) is a JavaScript SDK for developing web-based clients for virtual worlds powered by Vircadia. Vircadia domain servers provide the worlds (a.k.a. "domains") to visit, and the Vircadia metaverse server provides global services that connect the users and domains. See the user docs to Understand the Architecture.
This SDK provides interfaces to:
- Connect to domains.
- Use metaverse services.
The SDK is written in TypeScript.
To learn more about using Vircadia and exploring the metaverse, see the User Documentation.
For scripting API documentation, see the Vircadia API Reference.
Node.js version ≥ 10.13 ; LTS version ≥ 14.16 recommended
npm version ≥ 6.4.1 ; LTS version ≥ 6.14 recommended
https://nodejs.org/en/download/
Jest is used for unit testing. It is included as an NPM dev dependency, however, you may also install it globally if you want to. https://jestjs.io/.
git clone https://github.com/vircadia/vircadia-web-sdk.git
If you're working on Vircadia protocol code (that in the \src\domain
directory) it is recommended that you clone the SDK as
a subdirectory of the main Vircadia repo's source so that both sets of code are accessed when you open the main Vircadia repo's
source in your IDE. For example, if your clone of the main Vircadia repo's source is in C:\Workspaces\vircadia
then clone
the SDK repo's source into C:\Workspaces\vircadia-web-sdk
. Thus with the main Vircadia's repo loaded in your IDE, when
you search for code then both C++ and TypeScript results are returned, helping you compare the two codebases and keep them in
sync.
npm install
Loads all the supporting NPM packages as defined in package.json
into the node_modules
directory.
npm run build
Does a development compile and packages the SDK into the dist
directory.
npm run build-prod
Does a clean production compile and packages a releasable version of the SDK into the dist
directory.
npm run watch
Does a development compile and enables webpack to watch the sources and recomile when source files change.
This is often useful when testing SDK development using the example
tool.
npm run watch-prod
Does a clean production compile and enables webpack to watch the sources and recompile when the source files change.
npm run clean
All files:
npm run lint
A specific directory or file:
npm run lint-path <path>
Unit tests can be run without any external dependencies but integration tests require a domain server to be running on
localhost
or other location specified in ./tests/test.config.json
. The location and other values of the config JSON can be
overridden with environment variables, using the same property names, but prefixed with "VIRCADIA_".
All tests:
npm run test
Hot retest of all tests:
npm run test-watch
Specific tests (e.g., Packet.unit.test.js, all unit tests, all integration tests):
npm run test <partial-path>
npm run test /packet.unit
npm run test .unit.
npm run test .integration.
Run tests and report open handles:
npm run test-debug [<partial-path>]
SDK API documentation:
npm run sdkdoc
Developer documentation (includes SDK API documentation):
npm run devdoc
npm pack
This creates the SDK package for publishing to https://npmjs.com, vircadia-web-sdk-vvvv.v.v.tgz
.