Modules
Modules
Importable building blocks, served from the platform and cached across every prototype. Declare
them in prototir.json and your bundle stays tiny. The name tells
you the kind: bare npm names are libraries, prefab-… are starter modules, model-… are weights, and capability-… live in the SDK.
Looking for a complete starter project? Browse the separate Templates gallery. For packaging and manifest examples, use the creator guide.
Available modules may include a See in action link. These open-source demos are real, unlisted Prototir prototypes: they stay out of Discover, but you can play them, read the in-prototype explanation, and download or remix their source.
Starter modules
Small Prototir-built scaffolds imported into your code. These are modules, not complete project templates.
| module | genre | size | needs | status | what it does |
|---|---|---|---|---|---|
prefab-audio@0.1.0 | game | 2KB | - | available | Game/app audio over raw Web Audio: load samples from your bundle, play with volume/rate/loop, zero-asset beeps. Replaces maintenance-mode audio shims. |
prefab-audio-features@0.1.0 | art | 2KB | mic | available | Audio-reactive features from a native AnalyserNode: rms, energy, spectral centroid + raw bins. Mic (with consent) or any AudioNode/MediaStream. |
prefab-sketch@0.1.0 | art | 1KB | - | available | The byte-light creative-coding loop: full-window 2D canvas, dpr scaling, resize, draw(ctx, {t, dt, mouse}) — p5 ergonomics at ~1KB. |
prefab-hand-controls@0.1.2 | cv | 7.6MB | mediapipe-vision · camera | available | Hand landmarks → pointer/pinch events; camera + MediaPipe HandLandmarker + its model weights bundled in, no separate model pack needed. Reported pointer position is smoothed (configurable) to cut per-frame detector jitter without adding lag to pinch detection. |
prefab-voice-input@0.1.0 | ai | - | model-whisper-tiny · mic | planned | Push-to-talk → local transcript events. |
prefab-i18n@0.1.0 | core | 3KB | - | available | Localized strings and voice-over from your own bundle: Intl plurals/number/date, per-locale lazy loading, audio fallback chain. |
prefab-input@0.2.0 | core | - | - | available | One input API for desktop and mobile: keyboard, or fully customizable virtual controls — any number of buttons/joysticks/d-pads with position, size, shape and short/long-press semantics; same axes/pressed()/onPress() reads either way. |
prefab-shader-canvas@0.1.0 | art | - | - | available | Full-screen fragment shader boilerplate: uniforms for time/mouse/resolution. |
prefab-map@0.1.5 | app | 3640.0MB on CDN, streamed | maplibre-gl | available | Embeddable vector map: markers, popups, GeoJSON overlays, light/dark/grayscale themes, click/fly-to/pan-and-zoom. Real OpenStreetMap-derived roads, water, and towns worldwide, up to zoom 10 anywhere on Earth - no external tile host or API key, no CSP change, mandatory OSM/Protomaps attribution. The basemap is served on demand over ranged CDN fetches, like a shared image or model asset, not downloaded in full by every prototype that uses it. |
Libraries
Third-party runtimes, served from our CDN and cached across every prototype. Import them exactly like from npm.
| module | genre | size | needs | status | what it does |
|---|---|---|---|---|---|
three@0.185.1 | core | 404KB | - | available | 3D rendering — the workhorse for game/art prototypes. (r185 splits into module+core files, both platform-served; r170 stays available.) |
pixi@8.6.0 | core | 180KB | - | available | Fast 2D WebGL renderer. |
phaser@4.2.1 | game | 1.4MB | - | available | Batteries-included 2D game framework (scenes, tilemaps, arcade physics). (Phaser 4; the 3.87 API stays available as phaser@3.87.0.) |
p5@2.0.2 | art | 309KB | - | available | Creative coding (p5 2.x). For byte-light sketches see prefab-sketch. |
rapier3d@0.19.3 | game | 1.4MB | wasm | available | 3D physics (WASM). Pairs with three. (0.19 fetches its .wasm beside the module instead of embedding it; 0.14 stays available.) |
matter@0.20.0 | game | 26KB | - | available | Lightweight 2D physics (no WASM). |
tone@15.0.4 | art | 81KB | - | available | Web Audio synthesis & scheduling. |
lil-gui@0.20.0 | core | 14KB | - | available | Tiny tweak-panel for exposing prototype parameters. |
motion@12.42.2 | app | 46KB | - | available | Animation library (vanilla Motion One API). |
chart@4.4.7 | app | 69KB | - | available | Charts for dashboard/tool prototypes. |
d3@7.9.0 | app | 93KB | - | available | Data-driven documents for bespoke viz. |
maplibre-gl@6.0.0 | app | 138KB | - | available | Interactive vector maps (WebGL). The base for prefab-map; import it directly for custom map styling/layers beyond what the prefab exposes. |
simplex-noise@4.0.3 | art | 3KB | - | available | Procedural noise. |
onnxruntime-web@1.27.0 | cv | 3.5MB | wasm | available | ONNX inference runtime (WASM + WebGPU) — the base for model packs. |
transformers@3.2.0 | cv | 800KB | wasm | planned | Pipelines over ONNX: detection, segmentation, depth, ASR, embeddings. |
mediapipe-vision@0.10.18 | cv | 9.8MB | camera · wasm | available | Hands / pose / face landmarks — realtime body-driven interaction. |
Model packs
Weights (data, no code) for a runtime library. Downloaded once per visitor, shared by all prototypes.
| module | genre | size | needs | status | what it does |
|---|---|---|---|---|---|
model-rfdetr-nano@1.0.0 | cv | 30.0MB | onnxruntime-web | planned | RF-DETR nano object detection weights — real-time DETR in the browser. (YOLOv8 excluded: AGPL.) |
model-whisper-tiny@1.0.0 | ai | 40.0MB | transformers · mic | planned | Local speech-to-text — voice-controlled prototypes with zero API cost. |
model-depth-anything-small@1.0.0 | cv | 50.0MB | transformers | planned | Monocular depth from the webcam — parallax/AR-ish effects. |
Capabilities
Platform features brokered by the SDK (nothing to download): storage, AI, seeded RNG, camera/mic consent.
| module | genre | size | needs | status | what it does |
|---|---|---|---|---|---|
capability-ai@sdk | ai | SDK | - | available | Provider-neutral managed AI generation through Prototir.ai. The sandbox has connect-src 'none'; requests hop through the shell to a metered, moderated gateway. Prototir owns credentials and routing; the prototype owner's paid plan (Pro and above) supplies the daily allowance, with purchasable AI credits as a top-up. |
capability-storage@sdk | core | SDK | - | available | Per-prototype key-value persistence. Opaque-origin iframes have no reliable localStorage; the shell stores it namespaced per prototype (and per user when signed in). |
capability-permissions@sdk | cv | SDK | - | available | Camera/microphone: declared in prototir.json, granted via iframe allow= after an explicit shell-level user consent prompt. |
// declare: { "modules": ["three@0.170.0", "prefab-input@0.2.0"] } in prototir.json. Unknown or planned specs are rejected at upload