Skip to content
ShortPlay Developer Docs

ShortPlay SDK

The SDK is optional and pre-1.0. ShortPlay never requires it to publish or to be featured — the zero-integration baseline (an unmodified HTML5 bundle) already gets pause-on-swipe-away and reflow-on-grow for free, because the host drives real visibilitychange/blur/focus events and resizes your iframe. This has been the explicit stance since the first ShortPlay game jam: "not mentioned in the rules… the SDK is never required" (docs/125-game-jam-1-plan.md:53-58,109). Import it if it helps you; don't feel obligated to.

What exists today

import { ShortPlay } from './shortplay-sdk';

ShortPlay.game({
  build(container, accent, dims) {
    // construct your game into `container` at the given accent color + { w, h }
  },
  onFocus(focused) {},
  onPause() {},
  onResume() {},
  onResize(w, h) {},
  onStop() {},
});

ShortPlay.score(1200);
ShortPlay.event('level_complete', { level: 3 });

Full source, including the security model (source-identity + per-mount-nonce message authentication — the SDK is DX, not the trust boundary): app/games-sdk/shortplay-sdk.ts.

Distribution (v0)

There's no npm package yet. For now, the SDK is a single copyable TypeScript file — this docs site serves the exact same file the platform's own first-party games import: shortplay-sdk.ts. Drop it into your project and import it by relative path, the same way every ShortPlay first-party game does today, e.g.:

// app/games-dev/snake/v1/snake.ts:13
import { ShortPlay } from '../../../games-sdk/shortplay-sdk';

An npm package (@shortplay/game-sdk) is on the roadmap (docs/07-architecture-and-build-plan.md:142) but not shipped — the copyable file above is the real, current distribution path.

Roadmap (not yet available)

These are not shipped. Nothing on this site or in the SDK gives you access to them today — they're named here only so you know they're planned, not so you build against them:

These are tracked on the eng-sdk-v1 roadmap line and drafted directionally (unratified) in docs/128-sdk-multiplayer-device-wave.md — nothing there is available to build against yet.