@fifth-door/platform-sdk
v0.1.8
Published
Fifth Door platform SDK — one client for saved progress, generation, presence, and multiplayer in published games
Readme
@fifth-door/platform-sdk
The client a game uses to talk to the Fifth Door platform: saved progress and shared records (collections), the player's own record, a room document everyone renders, server time, presence, and in-game generation. One import, one client, every service.
import { createPlatformClient } from "@fifth-door/platform-sdk";
const client = createPlatformClient({ declarations });
const player = client.createPlayer<{ best?: number }>();
const reply = await client.generate({ prompt: "Respond to the player's choice." });The library binds to the runtime the host installs on the page. On Fifth Door that is one script tag:
<script src="/api/platform/sdk.js"></script>Games without a build step load the library and the runtime together and use it as window.FifthDoor:
<script src="/api/platform/sdk/0.1.8/sdk.js"></script>docs/guides/setup.md covers setup in full: binding, preview against the in-memory host, and the fifth-door.json declaration file. examples/ holds a complete project for each setup. Service-specific patterns are in docs/sdk/<topic>/topic.md; index.json lists every doc with the condition under which it applies. The same docs are rendered at fifthdoor.com/docs/sdk.
