@spmt/sdk
v0.1.1
Published
SPMT developer CLI and SpaceMountain identity, app registry, and game-event SDK
Readme
SPMT SDK 0.1
This is the installable partner SDK and spmt developer CLI. It is served directly by SPMT until the package is published to npm.
One-command project setup
npm exec --yes --package=@spmt/sdk -- spmt installIf npm is unavailable or you need the SPMT-hosted mirror, use the versioned package URL:
npm exec --yes --package=https://spmt.live/sdk/spmt-0.1.1.tgz -- spmt installThe command creates:
spmt.app.json— public app metadata; safe to commitspmt/publish-event.mjs— working game-event proof.env.example— names the required environment variables without storing a secret- a
.gitignoreentry for.env
Create an app-bound platform key at https://spmt.live/?view=developers, save it only in .env, and then run:
npx spmt doctor
npx spmt submit
node --env-file=.env spmt/publish-event.mjsSubmission creates or updates a review record. Owner approval promotes it into the public, installable app list.
Publishing an existing server-status JSON shape
SPMT wraps app data in a platform event, but the nested payload object can keep the app's original field names. For example, a Vintage Story server can write this to status.json:
{
"PlayerCount": 0,
"LastUpdated": "2026-07-13T21:22:42.3245966+00:00",
"Year": 3,
"DayOfYear": 11,
"Season": "Winter",
"IsTemporalStormActive": false,
"RiftActivity": "Unknown",
"ServerVersion": "1.22.3.0"
}Then publish it without renaming the fields:
npx spmt event server.status --data-file status.jsonHosted mirror fallback:
npm exec --yes --package=https://spmt.live/sdk/spmt-0.1.1.tgz -- spmt event server.status --data-file status.jsonThe stored event type becomes game.server.status, the source app comes from spmt.app.json, and the payload keeps the exact JSON shape above.
Server-side usage
import { SpaceMountainClient } from "./sdk";
const spmt = new SpaceMountainClient({
apiKey: process.env.SPMT_API_KEY,
appId: "atherrea",
});
await spmt.game.publish("session.started", {
sessionId: "demo-123",
playerCount: 1,
summary: "Atherrea session started",
});Browser/user-session usage
const spmt = new SpaceMountainClient({
token: () => localStorage.getItem("spmt_token") || undefined,
});
const me = await spmt.identity.me();
const apps = await spmt.apps.list();Modules
identityappsdevelopereventsgamecommlinkathenawebhooks
The SDK requires Node 18 or newer. Non-Node apps can use the same HTTPS contract; the Atherrea starter ZIP includes PowerShell and C# examples.
