JavaScript library to interface with OpenSpace using sockets and WebSockets.
Both the API and libary are still very much work in progress, and are subject to change.
A reference can be found here. Examples are available below:
https://github.com/OpenSpace/openspace-api-js/blob/master/examples/example.ts provides an example of how to connect from a NodeTS. To run it run the following in a terminal:
npm install
npm run examplehttps://github.com/OpenSpace/openspace-api-js/blob/master/examples/index.html provides an example of connecting to OpenSpace from a website. For simplicity, the example is self-contained in the index.html file.
For a proper example of how to interact with OpenSpace from a web application using npm, webpack and modern ES versions, please refer to https://github.com/OpenSpace/openspace-api-web-example.
Use Obserable notebooks to interact with OpenSpace locally: https://observablehq.com/@emiax/openspace-notebook-example This may be useful for tinkering, GUI prototyping and testing the lua interface during development.
The Lua function types in this package are generated against a specific OpenSpace version. If your OpenSpace version differs, the API will still work at runtime but type hints may be inaccurate. Check the package changelog to see which OpenSpace version the types were generated against.