Terminal app

The Terminal is a fixed kiosk clock in and out station, typically a shared tablet mounted at the entrance to a work site. Workers walk up, identify themselves by face, PIN, worker QR badge or NFC badge (or scan the terminal's own QR with their phone), and clock in or out without needing their own phone or a login of their own. Behind the scenes the Terminal opens an embedded copy of the Clock app to perform the actual clock action, so the two apps share the same clock in and out logic. The Terminal adds the shared-device layer on top: a home screen, ambient face identification, a manual login flow, a manager console, and a face enrollment flow.

For sites where biometrics are not permitted, see Terminal sign-in methods for the QR, NFC and terminal QR options and how to mix them per device.

What it solves

A single site often has many workers who arrive within the same short window. Handing each of them an individual app or asking them to remember a portal login does not scale, and paper sign-in sheets cannot be trusted for pay and compliance. The Terminal gives the site one trusted device that:

Who uses it

Where and how it runs

How it is configured

The Terminal is driven by a b3s__Component_Configuration__mdt record whose b3s__Type__c is Terminal. One such record ships as sample configuration with the package. Its b3s__JSON__c field holds the app definition. The shared JSON grammar (schedulables, selection clauses, merge placeholders such as :contextId, field paths) is documented in the App definition JSON reference; this article covers the keys specific to the Terminal.

Top level keys

Key Controls
timezonePreference Whose timezone datetimes are displayed in (user or the site/local timezone).
shiftStartedMessage / shiftEndedMessage Toast text confirming a clock in and a clock out, shown after the embedded Clock reports the action back to the Terminal.
backgroundSyncFrequency Seconds between background reloads of the site, manager, and worker rosters. Values under 10 are ignored (the sync is disabled) to protect the device.
managerPages Extra tabs shown inside the Manager View, in addition to the built-in Enroll and Settings tabs (see Manager console).
statQueries Which schedulables entries to run as the home-screen stat tiles, in display order.
clockInOutButtonLabel Label on the central home-screen button that opens the login flow.
notMeButtonLabel Label on the button that dismisses an ambiently identified person and opens manual login instead.
identifiedClearTimeoutMs Milliseconds of "no face seen" before an ambiently identified person is cleared from the home screen.
autoScanInBackground Face recognition. Enables the passive (ambient) face scan tile on the home screen and the camera option in the sign-in dialog. When off, no face matching runs anywhere on the device: workers tap to log in with a PIN, or use QR or NFC.
clockAppConfig Attributes forwarded onto the embedded Clock app (see below).
userInstructions Free text shown in the on-screen instructions modal for workers.
schedulables The object and query definitions, keyed by name (see Schedulables).

clockAppConfig

These booleans are passed straight through to the embedded Clock app to strip its chrome down for kiosk use. They default to hidden when omitted.

"clockAppConfig": {
    "hideThemeSwitch": true,
    "hideCurrentUser": false,
    "hideMenus": true
}
Key Effect
hideThemeSwitch Hides the light/dark toggle inside the embedded Clock.
hideCurrentUser Hides the "logged in as" identity chrome.
hideMenus Hides the Clock's own navigation menus, leaving only the clock action.

Schedulables

Each schedulable names an object and a selection clause, and the Terminal-specific ones add field paths so the app knows which fields carry the name, email, PIN, and biometric key. The shared clause and field-path grammar is in the App definition JSON reference; how these become server-side queries is covered in Loaders.

Name Object Purpose
countOnSite, scheduledToday, completedToday b3s__Shift__c Stat-tile queries selected by statQueries. Each carries a header and footer label for its tile.
site b3s__Site__c The pool of sites the kiosk can be bound to. Needs nameFieldPath and coordinatesPath (used to stamp the clock event's location).
manager Contact Managers who can unlock the Manager View. Filtered to contacts with a manager PIN. Needs nameFieldPath, emailFieldPath, biometricKeyFieldName, and pinFieldPath.
contact Contact The worker pool that can log in: contacts who are biometrics-enrolled or have a worker PIN. Needs the same four field paths as manager.
unregisteredContacts Contact Contacts still needing enrolment or a PIN. Feeds the Enroll tab so a manager can register them.

The stat-tile clauses filter by the bound site via :contextId and use standard date literals. For example, the sample "on site" tile counts shifts at the site that started but have not yet ended:

"countOnSite": {
    "objectType": "b3s__Shift__c",
    "selectionClause": [
        "b3s__Work_Site__c =:contextId AND b3s__Contact__c != null AND DAY_ONLY(b3s__Actual_Start_Time__c) >= YESTERDAY AND b3s__Actual_End_Time__c = null"
    ],
    "header": "On Site",
    "footer": "people"
}

The worker and unregistered pools are split on the enrolment fields, so a contact appears in exactly one of them:

"contact": {
    "objectType": "Contact",
    "selectionClause": [
        "(b3s__Biometrics_Enrolled__c = true OR b3s__Worker_Pin__c != '')"
    ],
    "nameFieldPath": "Name",
    "emailFieldPath": "Email",
    "biometricKeyFieldName": "b3s__Biometric_Key__c",
    "pinFieldPath": "b3s__Worker_Pin__c",
    "optionName": "Name"
}

On boot the app validates that the required field paths are present on the contact, unregisteredContacts, manager, and site schedulables and shows a clear setup error naming the missing key if any are absent, so misconfiguration fails loudly rather than silently.

Biometric and PIN fields

Identity data lives on the standard Contact object. The field API names are not hard-wired: they are declared through the schedulable field paths above, so an implementing org can point them at different fields. The sample configuration uses:

Field Purpose
b3s__Biometric_Key__c Long text holding the face data captured at enrolment. The Terminal writes and reads it; do not edit it by hand.
b3s__Biometrics_Enrolled__c Checkbox set to true on a successful enrolment. Used by the selection clauses that build the worker and unregistered pools.
b3s__Worker_Pin__c Fallback PIN for worker login when a face is not enrolled or the camera is unavailable.
b3s__Terminal_Manager_Pin__c PIN that gates the Manager View. Only contacts with this populated load as managers.

How identification and verification work

There are two paths:

Either way, identification only decides who the worker is; the clock action itself is then handed to the embedded Clock app, pre-anchored to the identified contact, the bound site, and its coordinates.

PIN fallback

If facial verification is unavailable or a worker is not enrolled, the login modal offers a PIN tab, so workers can enter their PIN instead. pinFieldPath names the Contact field that holds the worker's PIN. Wrong or missing PINs produce an inline message inside the modal rather than a toast. Manager login through the Manager View uses the same modal with the manager PIN.

Enrollment

Enrolment captures a worker's face and saves the face data to the contact. It happens in one of two places, using the same underlying capture component:

The capture flow walks through:

  1. Confirm the person to enrol.
  2. Check camera access (the browser prompts for permission).
  3. Capture several face samples across small movements, so recognition copes with angle and lighting.
  4. Save. The face data is written to b3s__Biometric_Key__c and b3s__Biometrics_Enrolled__c is set to true.

Once enrolled, the contact moves from the unregistered pool into the worker pool on the next background sync, and they can be recognised by the ambient scan. Re-enrolling replaces their face data.

Manager console

A manager unlocks the Manager View with their PIN or face. Its tabs are, in order: any pages you declare in managerPages, then the built-in Enroll tab, then the built-in Settings tab.

Per-device tunables

These are stored in the device's local storage, so each kiosk can be tuned independently without editing the shared configuration. At runtime the app reads local storage first, then the app definition, then a built-in default. The Settings tab writes them; a reset clears the overrides back to defaults.

Setting Default Controls
contextSiteId none The b3s__Site__c this kiosk is bound to. Drives the stat tiles and the clock event location.
backgroundSyncFrequency 30 Seconds between roster reloads (values under 10 disable sync).
detectionFrequency built in How often the camera feed is checked for a face.
detectionCertainty built in How confident detection must be before a face is accepted.
detectionInputSize built in Detection quality. Higher is more accurate but uses more of the device.
detectionScoreThreshold built in Minimum detection score.
faceMatchCertainty built in How strict face matching is. Lower is stricter.
identifiedClearTimeoutMs 1200 Milliseconds before an ambiently identified person is cleared.
autoScanInBackground true Face recognition on this device (ambient scan and sign-in dialog).
qrLogin, nfcLogin, reverseQr from configuration Sign-in methods on this device. See Terminal sign-in methods.

Background sync reloads the site, workers, managers, stat tiles and face data on each tick without restarting the camera, so a worker mid-scan is never interrupted. If a sync fails (for example a brief network drop), the Terminal keeps its current data and retries on the next tick. The Refresh button in the top bar does a full restart instead, re-reading device settings and restarting the camera, which is the quickest fix if the camera has stopped.

Org setup

Privacy considerations

Facial recognition on the Terminal is designed with privacy in mind: