Create an app

npx tinylib-sdk init my-app
cd my-app && npm install
npx tinylib-sdk dev

init gives you a small working app with host.json and editor types already set up: a counter in plain JavaScript, TypeScript or React, or a game for two or a list people share, each with a server.js that runs its rooms. --template game and --template list skip the question. dev runs it locally in the same sandboxed frame Tinylib uses, with a panel where you can edit the app's data and fire its notifications. Someone you invite to a room plays beside you on the same page. When it does what you want, npx tinylib-sdk publish puts it live and prints the link.

Types in your editor

The plain, game and list templates come with a jsconfig.json, so every .js file in the folder is typed, server.js included. Scripts written inline in the HTML aren't. For a .js file on its own, this line at the top does the same job:

/// <reference types="tinylib-sdk" />

A <script type="module"> can import files in the folder and npm packages, host from tinylib-sdk among them: check, publish and dev bundle it. The TypeScript and React templates compile to app.js with their own build script, since the build doesn't compile TypeScript or JSX.