The tablet app

This page is enough to deploy or fork the tablet. The Promethist Touch documentation provides the full reference — the wire protocol, the library’s three entry points, and building a client that is not a touchscreen at all.

How it works, in one idea

State goes out, commands come in.

  • Unreal publishes state: a flat list of named values — sessionActive, paused, volume, locale, blackout. Every connected tablet receives every change.

  • A tablet sends commands: a name and optionally a value — session + true, volume + 40.

This is the entire protocol. There are deliberately no acknowledgements: a button draws itself from published state, never from its own guess. Press Start and the button only flips when Unreal says the conversation exists. Two tablets in the same room can never disagree. A lost command shows up as an unchanged button, not a lie on the screen.

Both sides simply agree on command names. Mistype one and Unreal still logs it — Tablet command 'sesion' = 'true' — making it easy to find on the first press instead of chasing a silently failing button.

Where things are

packages/kiosk-tablet/     THE LIBRARY - install it, don't fork it
  src/core.ts                the client: socket, reconnect, state. No UI at all.
  src/ui.ts                  <pk-button> and <pk-slider>. Optional.
  src/protocol.ts            the message types.

apps/tablet/               THE SAMPLE APP - fork this, or ignore it
  index.html                 the markup
  src/tablet.ts               WHAT the tablet is: buttons, labels, translations, icons
  src/main.ts                HOW it is wired to the client
  src/prompts.ts             what the tablet asks the visitor (the five-star rating)
  src/gestures.ts            touch rules - see the warning below
  src/app.css                theme and layout
  public/config.json         how to reach the host, and nothing else
  public/icons/              the artwork this particular kiosk uses

Two rules that save time later:

  • Install the library, fork the app. @promethist/kiosk-tablet is versioned and published, so our bug fixes reach you without touching your interface (via npm update once the package is on a registry, or a fresh repo copy until then). The sample app is example code — edit or replace it. See Using the library directly.

  • config.json says where to connect; everything else about the tablet is in the source. If you change what a button does, you edit the source. If you change which machine the tablet talks to, you edit config.json. See below.

config.json, in plain terms

What it is: a small text file shipped alongside the tablet page at apps/tablet/public/config.json. It is not compiled — you can edit it with Notepad on a deployed kiosk.

Why it exists: the tablet page is identical everywhere. Something must tell each installation which machine to contact without rebuilding the page per site. This file does exactly that, and essentially nothing else.

What it holds: two settings, both usually blank.

Key What it does

url

the address of the control channel, e.g. ws://192.168.1.50:9010/link. Leave it out and the tablet works it out for itself — it takes the page’s address and assumes the control channel is on the same machine, on port 9010. This is correct for ordinary installations, which is why this file is usually empty

token

the control-channel token. Almost always leave this blank — see the warning below

When you do set url: when the tablet cannot assume "same machine as the page". In practice, this happens when the kiosk is reached via a tunnel or a public address, meaning the page arrives from one place while the control channel lives at another.

Do not put the token in config.json unless you are certain. Unreal serves this file to anyone who asks on the same port as the page. One GET /config.json hands a stranger your token via the very thing it was protecting. tablet.bat instead puts the token in the page URL’s fragment (http://kiosk:8080/#token=…), which browsers never send to a server.

The token field is only correct in one case: you serve the tablet page yourself from somewhere the public cannot reach, rather than letting Unreal serve it.

Five minutes to a running tablet

npm install
npm run dev          # sample app on http://localhost:5173
npm run build        # library + app; the app lands in apps/tablet/dist

Deploying means copying apps/tablet/dist somewhere it can be served. On a standard kiosk, deploy_extras.bat puts it where Unreal looks, requiring no further installation.

The Unreal side is on by default. A packaged build serves the page on 8080 and listens for a tablet on 9010. You only need this section to change a port, lock the channel, or run it in the editor. The configuration file is the project’s Saved/PromethistLinkConfig.ini, and README.md contains the full list of keys:

[PromethistKioskTablet]
Enabled=true
Port=9010
WebPort=8080
; Ships matching tablet.bat, so a tablet on another box connects with no setup.
; Replace it if the network is not exclusively yours - it is printed in this guide.
; A tablet on THIS machine never needs it. Comments go on their OWN line:
; everything after the first = is the value.
AuthToken=promethist-kiosk-default
; Demand the token even from this machine. Turn on when a tunnel or proxy runs
; here and forwards the channel, i.e. the streamed shapes.
RequireTokenFromLocal=false
; Optional hard lockdown: 127.0.0.1 makes the port unreachable from the network.
; Empty = every interface, which is the default and is fine.
BindAddress=
; needed as well if you are testing in the editor
EnableInEditor=false

If you set AuthToken, put the same value in TABLET_TOKEN within tablet.bat on the tablet box, and not in config.json — see locking the control channel.

The engine plugins required by PromethistLink are listed under what the plugin needs from your project, in Part 1.