TypeScript bindings and test harness for the Spacetime DB module (Bitcraft).
Before running the test script, complete these steps:
-
Navigate to the folder for your version of stdb
Each version has its own directory (e.g.
ts-1-12-0/).cdinto the one that matches your Bitcraft/stdb version. -
Verify your Spacetime CLI version
Run
spacetime --versionin your terminal and confirm it matches the folder version you're using. -
Install dependencies
npm install
-
Update the bindings (also included as a
.shfile in./scripts)npm run update-bindings
-
Configure environment Create a
.envfile in the project root and add your Bitcraft auth token:BITCRAFT_AUTH_TOKEN=eyJ0...Replace
eyJ0...with your actual token value.
After setup is complete:
npm testOr:
npm startBoth commands run the test script at scripts/test.ts, which exercises the global and region modules against the Spacetime DB bindings.
If you aren't getting an error, but you are instantly getting disconnected - try running the test while you are logged into the game (via the unity client)