Live demo
A working storefront on the staging API — watch the realtime frames arrive
Live demo
A till, wired to staging-api.loyalty.lt. It opens a QR card session the moment it
loads — the way a real terminal sits waiting — connects to the channel, and prints
every frame as it lands.
Scan the code in the Loyalty.lt app, or type the nine digits underneath it — the app's
entry sheet takes the same session either way. Without the app you still see the socket
connect and the expired frame arrive when the five-minute window runs out.
What it is doing
The page holds no credentials. That is the split every public site should use:
The server opens the session
A route holding the staging API key calls
POST /{locale}/shop/qr-card/generate and returns only session_id, qr_code,
manual_code and expires_at.
The browser subscribes
With that session_id it joins qr-card.{session_id}. The channel is public — the
unguessable session ID is the secret — so the page needs nothing else.
The customer scans, or types
Both land on the same session. manual_code is nine digits shown as XXX-XXX-XXX;
the app has an entry sheet for it, for when a camera will not focus or the till screen
is washed out under the lights.
The result arrives on the channel
card_identified carries the card, its balance and the customer. The demo prints the
raw payload, which is the shape documented in
Realtime.
This runs against staging with demo data. Never put production credentials behind a public page, and never ship an API secret to a browser.
Build the same thing
Channels, events and exact payloads
The QR login flow this demo runs