Skip to main content

Getting started

Create a standalone Roku application with the starter included in Hosanna Tools. The starter supplies the application source, configuration, browser host and Roku host. It installs the Apache-2.0 framework SDK from npm. Hosanna UI supports Roku only; the browser host emulates Roku for development and testing. The npm dependencies include the compiler for Roku builds; browser development does not execute it. No compiler license key is required.

If you already have an application checkout, use Restore an existing app below instead of creating another one.

Lifecycle from locked npm dependencies through framework integration, browser emulation, and Roku compilation with the npm compilerLifecycle from locked npm dependencies through framework integration, browser emulation, and Roku compilation with the npm compiler

Prerequisites​

  • Install Node.js 24.17.0 or newer within Node 24, with npm. Once the app exists, its .nvmrc and package.json record the required version.
  • Use macOS or glibc-based Linux on x64 or arm64. WSL with a supported Linux distribution also works; native Windows and Alpine/musl compiler packages are not provided.
  • Install Git, or pass --no-git when creating the app.
  • Use a TypeScript-capable editor, such as VS Code.

The original four starters are available from Hosanna Tools 5.1.0. The complete app and its MVVM variant described here require Tools 5.2.0 and use SDK 2.0.4. The commands below select Tools 5.2.0 explicitly. They require Tools 5.2.0 and SDK 2.0.4 to be published on npm; until then, use reviewed local builds of both packages. Tools 5.1.1 supports npm compiler resolution but does not include these expanded app starters.

Choose a starter​

Hosanna Tools includes five starters. Each supplies app.code-workspace, npm scripts and a README for its workflow.

TemplateCreatesFirst check
appA Roku app with a browser emulator, navigation, content rails, details and video playbacknpm run dev
app-mvvmThe same app with observable view models bound to its viewsnpm run dev
gameA Roku game with a browser emulator using the Hosanna game runtimenpm run dev
libraryA reusable TypeScript npm package for shared classes and servicesnpm run test:package
component-libraryStandalone SceneGraph nodes, browser contract tests and a plain Roku consumernpm test

Select one with --template, for example:

npx --yes --package @tantawowa/hosanna-tools@5.2.0 hst template:create my-mvvm-app --template app-mvvm
npx --yes --package @tantawowa/hosanna-tools@5.2.0 hst template:create my-game --template game
npx --yes --package @tantawowa/hosanna-tools@5.2.0 hst template:create my-library --template library
npx --yes --package @tantawowa/hosanna-tools@5.2.0 hst template:create my-components --template component-library

The default is app. Choose app-mvvm if you want screen state and commands in view models, with views binding that state to controls. Both app starters have the same screens, artwork, playback controls and browser journey. Their browser, IDE and Roku commands are identical. The steps below create the default app; add --template app-mvvm to use the MVVM variant instead.

For game, use the same browser, IDE and Roku commands and follow the generated README for game controls. For either library starter, follow its README after creation. A source library publishes an npm tarball with JavaScript and TypeScript source entries. Its README covers the app-owned source link needed for Roku compilation. A component library packages a ZIP for Roku's ComponentLibrary loader.

1. Create the app​

Run this from the directory where you keep your projects. Choose a destination that does not already exist:

npx --yes --package @tantawowa/hosanna-tools@5.2.0 hst template:create my-app
cd my-app

The command creates the app, installs its npm dependencies and runs its setup script. For the app starter, setup integrates the SDK source links and generates the TypeScript contracts. It uses the starter shipped in the npm package; you do not need access to a template repository or framework checkout.

Keep package.json and package-lock.json in version control. They select the framework, tools and compiler versions; npm ci restores all three. The app starter does not need hosanna.json. The game starter retains an optional source-link override in that file; package versions still belong in npm. AppConfig, build-config and HST/compiler project files still configure the application. Keep dependencies, generated output, SDK source links and local credentials ignored.

To inspect the starter before installing anything, add --no-install. Then run npm install and npm run setup inside the new directory before continuing.

2. Open the app in your editor​

code app.code-workspace

If the code command is unavailable, open VS Code and choose File → Open Workspace from File, then select my-app/app.code-workspace. You can also open the application root as a folder in another TypeScript-capable editor. See VS Code setup for extension installation and the supplied tasks.

3. Launch the Roku browser emulator​

From the app's terminal:

npm run dev

This runs hst run browser dev emulator. HST starts generation, Vite and the debugger services. Open the URL printed by the command. Use arrow keys for directional focus, Enter for Select/OK, and Backspace for Back. Click the app first if another browser element owns keyboard focus.

The app opens Home with a featured image and content rails. Its four catalogue entries describe fictional demo journeys. Every entry plays the same local, credited Sintel trailer, about 52 seconds long with audio. Browsing and playback need no backend, account or asset server.

  1. Move between Home cards with the arrow keys and press Enter to open details.
  2. Choose Play preview. Use Pause, Resume, −10 seconds and +10 seconds to control the video. Replay is available when it finishes.
  3. Press Backspace to return to details, then again to return to the selected card. Leaving the player stops playback.
  4. Move Up from the top of Home to the menu, choose Browse, then move Down into the collection grid.

The Roku remote uses OK and Back for the same flow, with Play/Pause, Rewind and Fast Forward for playback.

4. Make and validate a change​

Edit src/app/catalog.ts to replace the demo titles, images and row definitions. Each entry supplies videoUrl, videoTitle and streamFormat, using mp4 or hls for playback. AppShell.ts owns the menu, HomeScreen.ts and BrowseScreen.ts own browsing, and DetailsScreen.ts and PlayerScreen.ts own details and playback. StarterActionManager.ts routes navigation actions. Use assets/meta/app.config.json for appearance.

In app-mvvm, the screen view models own state and commands. Each view declares a typed viewModel, reads it while composing controls and forwards user intent to its methods. Hosanna observes decorated model fields and forwards start, suspend, resume and dispose as the view appears, hides, returns and unmounts. The generated README maps each screen to its model and explains the boundary. See screen behaviour in a view model for the public binding API.

The demo artwork lives in assets/images/starter/ and the trailer in assets/videos/starter-preview.mp4. Runtime paths start with pkg:/assets/. Keep the asset notices in THIRD_PARTY_NOTICES.md for any sample media you retain. When replacing the catalogue, make titles, descriptions and durations match your media, and update the demo note and displayed credits in the details and player screens.

Generated factories and state contracts belong under src-generated/ and should not be edited. The starter includes these checks:

npm run generate
npm run lint
npm test
npm run build:browser

The optional browser journey starts its own test server and browser. Install Chromium once, then run it from the app root:

npm exec -- playwright install chromium
npm run test:ui

On Linux, use npm exec -- playwright install --with-deps chromium if browser system libraries are missing. Set HS_TEST_HEADED=1 to watch the test. Failure artifacts are written under test-results/. See the generated README and test/ui/ for the journey and configuration.

Continue with Hosanna fundamentals before creating a new view. Keep the app's manifest and lockfile together when changing SDK or tool versions.

5. Prepare Roku development​

Roku compilation uses @tantawowa/hsc, already installed with the starter dependencies. Check the installation, then build:

npx hsc --version
npx hst doctor
npm run build:roku

If the compiler or SDK integration is missing, run npx hst doctor --fix to repair the project-selected installation. See Compiler and tool setup for version changes and migration.

Enable Roku developer mode, select the device and supply its installer password through ROKU_DEVPASSWORD or ignored local credentials. Reserve shared lab hardware through your team's Device Deck workflow before deploying. Building for Roku covers these steps.

Then build, deploy and stream device logs:

npm run run:roku -- --device "<roku name or ip>"

Verify the same interaction on the Roku remote. Keep device checks for input, playback, memory and performance in your development loop.

Restore an existing app​

Existing app lifecycle from locked npm dependencies through framework integration, browser emulation, and npm compiler installation for RokuExisting app lifecycle from locked npm dependencies through framework integration, browser emulation, and npm compiler installation for Roku

After cloning an app created with this workflow, run these commands from its root:

nvm use
npm ci
npm run setup
npm run dev

If you do not use nvm, select the app's required Node version with your version manager. npm ci restores the locked framework, tools and platform compiler dependencies. The starter's setup script repairs SDK source links and regenerates contracts.

Older applications must complete the npm migration first. Installing the SDK into an unrelated npm project does not create an application host; use template:create for a new app.

Talk to us