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.

modulegenresizeneedsstatuswhat it does
prefab-audio@0.1.0 game2KB-availableGame/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 art2KBmicavailableAudio-reactive features from a native AnalyserNode: rms, energy, spectral centroid + raw bins. Mic (with consent) or any AudioNode/MediaStream.
prefab-sketch@0.1.0 art1KB-availableThe 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 cv7.6MBmediapipe-vision · cameraavailableHand 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 · micplannedPush-to-talk → local transcript events.
prefab-i18n@0.1.0 core3KB-availableLocalized 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--availableOne 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--availableFull-screen fragment shader boilerplate: uniforms for time/mouse/resolution.
prefab-map@0.1.5 app3640.0MB on CDN, streamedmaplibre-glavailableEmbeddable 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.

modulegenresizeneedsstatuswhat it does
three@0.185.1 core404KB-available3D rendering — the workhorse for game/art prototypes. (r185 splits into module+core files, both platform-served; r170 stays available.)
pixi@8.6.0 core180KB-availableFast 2D WebGL renderer.
phaser@4.2.1 game1.4MB-availableBatteries-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 art309KB-availableCreative coding (p5 2.x). For byte-light sketches see prefab-sketch.
rapier3d@0.19.3 game1.4MBwasmavailable3D 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 game26KB-availableLightweight 2D physics (no WASM).
tone@15.0.4 art81KB-availableWeb Audio synthesis & scheduling.
lil-gui@0.20.0 core14KB-availableTiny tweak-panel for exposing prototype parameters.
motion@12.42.2 app46KB-availableAnimation library (vanilla Motion One API).
chart@4.4.7 app69KB-availableCharts for dashboard/tool prototypes.
d3@7.9.0 app93KB-availableData-driven documents for bespoke viz.
maplibre-gl@6.0.0 app138KB-availableInteractive 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 art3KB-availableProcedural noise.
onnxruntime-web@1.27.0 cv3.5MBwasmavailableONNX inference runtime (WASM + WebGPU) — the base for model packs.
transformers@3.2.0 cv800KBwasmplannedPipelines over ONNX: detection, segmentation, depth, ASR, embeddings.
mediapipe-vision@0.10.18 cv9.8MBcamera · wasmavailableHands / 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.

modulegenresizeneedsstatuswhat it does
model-rfdetr-nano@1.0.0 cv30.0MBonnxruntime-webplannedRF-DETR nano object detection weights — real-time DETR in the browser. (YOLOv8 excluded: AGPL.)
model-whisper-tiny@1.0.0 ai40.0MBtransformers · micplannedLocal speech-to-text — voice-controlled prototypes with zero API cost.
model-depth-anything-small@1.0.0 cv50.0MBtransformersplannedMonocular 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.

modulegenresizeneedsstatuswhat it does
capability-ai@sdk aiSDK-availableProvider-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 coreSDK-availablePer-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 cvSDK-availableCamera/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