# Emda: full documentation for AI agents Source: https://emda.io/docs · Index: https://emda.io/llms.txt # AI agents Using an AI coding agent (Claude Code, Cursor, GitHub Copilot, Codex…) to connect your site or system to Emda? Give it these, and it can write the integration correctly the first time. | File | What it is | | --------------------------------------- | ----------------------------------------------------------------------------- | | [emda.io/llms.txt](https://emda.io/llms.txt) | A short index of Emda's docs for AI agents | | [emda.io/llms-full.txt](https://emda.io/llms-full.txt) | All the docs in one plain-text file: Page API, Remote API, features and setup | | [emda.io/emda.d.ts](https://emda.io/emda.d.ts) | TypeScript types for `window.Emda` | | [emda.io/openapi.json](https://emda.io/openapi.json) | The Remote API as OpenAPI 3.1, for generating clients | | `npm install @emda/web` (coming soon) | Helpers, types and a fake kiosk for local development | ## Quick start Tell your agent: > Read https://emda.io/llms-full.txt and add Emda receipt printing to the checkout page. Use the > types from https://emda.io/emda.d.ts. For a lasting setup, add the rules below to your project's agent instructions: `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/emda.md` or `.github/copilot-instructions.md`. Then save [emda.d.ts](https://emda.io/emda.d.ts) in your project (for example `src/types/emda.d.ts`) so the types are always there. ## Rules for your agent Copy this block as it is: ```md ## Emda kiosk integration This site runs on Emda kiosks (https://emda.io). Full reference: https://emda.io/llms-full.txt. Types for window.Emda: https://emda.io/emda.d.ts (save as src/types/emda.d.ts), or use the @emda/web package (whenReady, printReceipt, …; @emda/web/mock gives a fake kiosk for development). Remote API as OpenAPI 3.1: https://emda.io/openapi.json. Page API (JavaScript in our pages, running in the kiosk): - `window.Emda` is undefined outside Emda, and each part exists only when the kiosk enables it: page integration (`version`, `getDeviceInfo`, `print`, `printUrl`, `home/reload/back/forward`), `Emda.receipt` (receipt printer) and `Emda.scale` (scale). Always feature-detect: `window.Emda?.receipt`, never assume. - Wait for it: `if (window.Emda) start(); else addEventListener('emda:ready', start, { once: true });` Also keep a normal path for regular browsers (the same page may open on a phone or a PC). - Receipts are HTML printed at paper width: 58 mm = 384 CSS px, 80 mm = 576 CSS px, 1 CSS px = 1 printer dot, black on white. Use inline styles and inline (data:) or https images; scripts in the receipt don't run. Hebrew and RTL work (`dir="rtl"`). ~24px is a normal line, ~40px a heading. - Receipt and print calls resolve `{ ok: true }` or `{ ok: false, error }`; they don't throw. Show a friendly message for `printer-unreachable`, `printer-failed`, `receipt-disabled`, `not-licensed`. - Scale calls reject with `{ code, status, message }` (`not_connected`, `timeout`, `not_supported`, …). Use `Emda.scale.waitForStable({ onReading })` for live weight and keep its `cancel()` for cleanup. Weights are in kilograms. - `Emda.printUrl(url)` and `Emda.receipt.printUrl(url)` only print pages the kiosk's site rules allow (`error: 'blocked'` otherwise). - Don't depend on `deviceId` for security: any page in the kiosk can read it. Remote API (our server or tools, over the local network): - `http://:8081/api/v1/...` with `Authorization: Bearer `; JSON bodies; responses `{ ok: true, ... }` or `{ ok: false, error }` with an HTTP status. - Never call it from browser code (no CORS) and never ship the token to the client. - 402 `not-licensed` means the kiosk's licence doesn't include that feature; 409 `admin-open` means someone is in the kiosk's Settings: retry later. ``` ## Tips - **Test without a kiosk:** keep the page working when `window.Emda` is missing, and ask the agent to add a small fake `window.Emda` for local development that logs receipts instead of printing. - **Receipts:** ask for a print-preview element sized 384 or 576 px wide, so you can check the layout in a normal browser before printing. - **Turn the features on in Emda:** the page API parts appear only when enabled in the kiosk: **Settings → Remote API → Allow page integration**, **Settings → Devices → Use a receipt printer**, **Settings → Devices → Use a scale**. - **Human docs:** [Page API](https://emda.io/docs/page-api), [Remote API](https://emda.io/docs/api). --- # Page API (`window.Emda`) For your website running in the kiosk: print, print receipts, open the cash drawer and read the scale from the page's own JavaScript. To control kiosks from a server, see the [Remote API](https://emda.io/docs/api). Working with an AI coding agent? See [AI agents](https://emda.io/docs/ai-agents). Emda adds a `window.Emda` object to pages when page integration or the receipt printer is on. It's set up before the page's own scripts run; to be safe, wait for it: ```js function start() { /* use Emda */ } if (window.Emda) start(); else window.addEventListener('emda:ready', start, { once: true }); ``` ## The `@emda/web` package Optional helpers and types for the page API (coming soon to npm). The kiosk provides `window.Emda` itself; the package just makes it easier to use, and adds a fake kiosk for development: ```sh npm install @emda/web ``` ```ts import { whenReady, printReceipt, waitForStableWeight } from '@emda/web'; import { installMock } from '@emda/web/mock'; // On your computer there's no kiosk: show receipts in a preview and fake the scale. if (import.meta.env.DEV) installMock({ receipt: 80, scale: 0 }); const emda = await whenReady(); // the kiosk's API, or null in a normal browser const result = await printReceipt('

Thank you

', { cut: true }); if (!result.ok) showError(result.error); // 'unavailable' outside Emda, or the printer's error ``` - `whenReady()` resolves with `window.Emda`, or `null` when the page isn't in a kiosk. - `printReceipt`, `printReceiptUrl`, `openCashDrawer`, `printUrl` return `{ ok: false, error: 'unavailable' }` outside Emda instead of failing; `print()` falls back to the browser's dialog. - `getWeight` and `waitForStableWeight` reject with `not_connected` outside Emda. - `installMock()` (development only) adds a stand-in `window.Emda`: receipts appear in a preview at real paper width, `setWeight(kg)` drives the scale, `failNextReceipt('printer-unreachable')` tests your error handling. Without the package, use `window.Emda` directly as below; the types are at [emda.io/emda.d.ts](https://emda.io/emda.d.ts). ## Page integration With **Settings → Remote API → Allow page integration** on, every page in the kiosk gets: ```js Emda.version; // "0.1.0" await Emda.getDeviceInfo(); // { deviceId, appVersion, platform } Emda.print(); // same as window.print(): follows the printing settings await Emda.printUrl('https://shop.example/invoice/7'); // that page on the normal printer → { ok } / { ok:false, error } Emda.home(); Emda.reload(); Emda.back(); Emda.forward(); ``` It's off by default: any page shown in the kiosk can read the device ID while it's on. ## Receipt printer (`Emda.receipt`) With **Settings → Devices → Use a receipt printer** on, pages get `Emda.receipt` (whether or not page integration is on). Receipts are HTML: Emda draws them at the printer's width (58 mm paper = 384 px, 80 mm = 576 px; 1 CSS pixel = 1 printer dot), in black on white, and prints the result as an ESC/POS raster image. Hebrew, fonts, tables and images print exactly as they look. Scripts in the receipt HTML don't run; use inline styles and inline (`data:`) or web images. ```js const result = await Emda.receipt.print( `
Emda Café
קפה הפוך — ₪14.00
`, { cut: true, openDrawer: false }, ); // options override the settings; both optional // → { ok: true } or { ok: false, error: 'receipt-disabled' | 'printer-unreachable' | 'printer-failed' | 'render-failed' } // Or a receipt page by address: loaded at paper width with the kiosk's cookies (signed-in // pages work) and its own scripts; it must be allowed by the kiosk's site rules. await Emda.receipt.printUrl('https://pos.example/order/42/receipt', { cut: true }); await Emda.receipt.openDrawer(); // cash drawer on the printer's drawer port ``` Connections: a network printer by address (raw TCP, port 9100 unless set), or a USB printer installed in Windows (sent raw through its print queue; a "Generic / Text Only" or the vendor's driver works). Tip: design for the width — e.g. `font-size: 24px` is a normal receipt line, `40px` a heading. ## Scale (`Emda.scale`) With **Settings → Devices → Use a scale** on, pages get `Emda.scale` (whether or not page integration is on). Emda talks to the scale itself — SHEKEL scales (Beaver protocol: Basic, Advanced 1, Advanced 2) and Wintec S373 boards — so no separate scale service is needed. How the scale connects depends on the device: on Windows a serial / USB COM port or the network; on Android a USB-to-serial adapter (OTG), a built-in serial port or the network; on iPad the network only (the scale itself, or a serial-to-network adapter such as USR-TCP232 or Moxa NPort, since iPads can't open serial adapters). It has the same shape as maxshop's `ScaleService`, and readings have the same fields as `shekel-scaled`'s `GET /api/v1/weight`: ```js const r = await Emda.scale.getWeight(); // { status: 'stable' | 'unstable' | 'zero' | 'negative' | 'overweight' | …, statusRaw, weight: 1.234, // hasWeight: true, stable: true, overweight: false, underweight: false, raw: 'WGT:1 1.234P 0.000' } Emda.scale.isUsableReading(r); // stable && hasWeight && in range && weight > 0 const { promise, cancel } = Emda.scale.waitForStable({ timeoutMs: 30000, intervalMs: 400, onReading: (reading, errorCode) => showLive(reading, errorCode), // every poll }); const stable = await promise; await Emda.scale.zero(); await Emda.scale.setTare(0.28); // kg; Emda.scale.clearTare() await Emda.scale.setUnitPrice(12.9); await Emda.scale.getTotal(); // SHEKEL only await Emda.scale.getFirmware(); ``` Failures reject with `{ code, status, message }`, codes as in `shekel-scaled`: `not_connected` (503), `timeout` (504), `bad_response` (502), `bad_request` (400), `not_supported` (501 — Wintec has no price / total / checksum / reboot), and `cancelled` from `waitForStable(...).cancel()`. For a page that also runs outside Emda: `const scale = window.Emda?.scale ?? ScaleService;` --- # Remote API Control a kiosk over the network: open pages, take screenshots, show messages, turn the screen off, change settings. Turn it on in **Settings → Remote API**. It's off by default. For scripts in the kiosk's own pages, see the [Page API](https://emda.io/docs/page-api). - Address: `http://:8081/api/v1/…` (the port can be changed; Settings shows the address) - Every request needs the access token: `Authorization: Bearer `. Settings creates a random token when you turn the API on, and can show it or replace it. - **Allowed addresses** (optional): one IP address or CIDR range per line, e.g. `192.168.1.0/24`, `10.0.0.7`, `fd00::/8`. Other callers get `403`. Empty = any device that can reach the kiosk. - Plain HTTP on the local network. Treat the token like a password; put the kiosk on a network you trust, or restrict the allowed addresses. - Web pages can't call the API (no CORS headers), even from the kiosk itself. - Request bodies are JSON (`Content-Type: application/json`), at most 1.2 MB (receipt HTML can carry inline images). An empty body is the same as `{}`. Responses are JSON: `{ "ok": true, … }`, or `{ "ok": false, "error": "" }` with an HTTP error status. `GET /screenshot` returns a PNG. ## Errors | Status | `error` | Meaning | | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | 401 | `unauthorized` | Missing or wrong token (checked before the path) | | 403 | `forbidden` | Caller's IP isn't in the allowed addresses (checked first) | | 404 | `not-found` | No such endpoint | | 405 | `method-not-allowed` | Wrong method for this endpoint | | 413 | `too-large` | Body over 1.2 MB | | 400 | `invalid-receipt` (send exactly one of html / url), `invalid-html`, `invalid-cut`, `invalid-drawer`, `invalid-json`, `invalid-url`, `invalid-clear`, `invalid-active`, `invalid-on`, `invalid-text`, `invalid-seconds`, `invalid-config`, `download-failed` | Bad request body | | 409 | `admin-open` | Someone has Settings (or the PIN pad) open on the kiosk; try again later | | 402 | `not-licensed` | The feature is set up but this device's licence doesn't include its package (Settings → Emda Pro) | | 409 | `printing-disabled` | `POST /print` while printing is off in Settings | | 409 | `receipt-disabled` | `POST /receipt` or `/drawer` while the receipt printer is off | | 502 | `printer-unreachable`, `printer-failed` | The receipt printer didn't answer or refused the job | | 500 | `print-failed`, `clear-…-failed`, `internal` | The kiosk couldn't do it | | 503 | `screenshot-unavailable` | The screen couldn't be captured right now; try again | ## Endpoints | Method | Path | Body | Does | | ------ | ------------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | GET | `/api/v1/ping` | | `{ "ok": true }`; checks the token | | GET | `/api/v1/status` | | Device and kiosk state (below) | | GET | `/api/v1/screenshot` | | PNG of what the screen shows | | GET | `/api/v1/config` | | `{ "config": … }` — current settings without the PIN hash, token, client certificate key and its password | | POST | `/api/v1/config` | `{ "code": "emda:1:…" }` or `{ "config": { … } }` | Replaces the settings like an import (setup code, settings JSON, or a web address of a settings file). The kiosk's PIN, API token and client certificate are kept unless the new settings include them | | POST | `/api/v1/navigate` | `{ "url": "https://…" }` | Opens a page (http/https). Admin authority: the allowed/blocked sites lists don't apply | | POST | `/api/v1/home` | | Home page | | POST | `/api/v1/reload` | | Reload | | POST | `/api/v1/back` | | Back | | POST | `/api/v1/forward` | | Forward | | POST | `/api/v1/clear` | `{ "history": true, "cache": true, "cookies": true }` (at least one `true`) | Clears browsing data | | POST | `/api/v1/screensaver` | `{ "active": true }` | Shows the screensaver (until a touch or `active: false`) | | POST | `/api/v1/screen` | `{ "on": false }` | Turns the screen off (black) until `on: true`; the admin gesture still opens Settings | | POST | `/api/v1/print` | `{ "url": "https://…" }` (optional) | Prints the current page — or that page — with the printing settings, without a dialog | | POST | `/api/v1/message` | `{ "text": "…", "seconds": 10 }` | Shows a message over the page (1–500 characters, 1–600 s, default 10) | | POST | `/api/v1/restart` | | Restarts the app | | POST | `/api/v1/receipt` | `{ "html": "…" }` or `{ "url": "https://…" }`, plus optional `cut`, `openDrawer` | Prints an HTML receipt, or a receipt page by address (`cut` / `openDrawer` override the settings) | | POST | `/api/v1/license` | `{ "key": "EMDA1.…" }`, or `{ "key": null }` to remove it | Installs or removes the licence key: `{ "license": { … } }`; `400 invalid-license` | | POST | `/api/v1/drawer` | | Opens the cash drawer connected to the receipt printer | | GET | `/api/v1/content` | | `{ "content": { "installed", "files", "bytes", "updatedAt", "source", "error" } }` — the local content at `emda://local/` | | PUT | `/api/v1/content` | the `.zip` itself as the request body (up to 1 GB) | Replaces the local content. `422` with `no-index`, `unsafe-path`, `invalid-zip`, `too-big` or `too-many-files` keeps the old content | | DELETE | `/api/v1/content` | | Removes the local content | | POST | `/api/v1/content/update` | | Downloads the `.zip` address from Settings now: `{ "updated": true/false }`. `409 no-zip-url`, `402` without Pro, `502` if the download fails | ### OpenAPI The whole API as OpenAPI 3.1: [emda.io/openapi.json](https://emda.io/openapi.json). Import it into Postman or Insomnia, or generate a typed client in your language (C#, Java, Python, TypeScript…) with [OpenAPI Generator](https://openapi-generator.tech) or NSwag. ### `GET /api/v1/status` ```jsonc { "ok": true, "deviceId": "a1b2c3d4-…", // Settings → Diagnostics shows the short form "appVersion": "0.1.0", "platform": "Windows 10.0.22631", "internalIps": ["192.168.1.23"], "mode": "kiosk", // kiosk | screensaver | off | shabbat | offline | pin | settings | setup "screen": "on", // on | off | shabbat "url": "https://clinic.example/checkin", "title": "Check-in", "locked": true, "entitlement": "free", "idleSeconds": 42, "uptimeSeconds": 86400 } ``` ### Examples ```sh TOKEN=…; KIOSK=http://192.168.1.23:8081/api/v1 curl -H "Authorization: Bearer $TOKEN" $KIOSK/status curl -H "Authorization: Bearer $TOKEN" -d '{"url":"https://menu.example/he"}' $KIOSK/navigate curl -H "Authorization: Bearer $TOKEN" -d '{"text":"Closing in 10 minutes","seconds":30}' $KIOSK/message curl -H "Authorization: Bearer $TOKEN" -o screen.png $KIOSK/screenshot curl -H "Authorization: Bearer $TOKEN" -d '{"on":false}' $KIOSK/screen ``` ### Local content The kiosk can show your own site — an `index.html` with its CSS, scripts, images and videos — from the private address `emda://local/` (use it as the home page or in bookmarks), with no internet. A `.zip` may hold the site at the top or inside one folder. Example upload: ```sh curl -X PUT --data-binary @kiosk.zip -H "Authorization: Bearer $TOKEN" $KIOSK/content ``` ### On iPad The iPad app answers the same requests with the same errors. Differences: - **Local network permission:** iOS asks once whether Emda may use the local network. If it's refused, other devices can't reach the API; Settings → Remote API says so, and it's turned back on in iOS Settings → Privacy & Security → Local Network → Emda. - **`POST /restart`** starts the kiosk fresh (new browser, home page) instead of relaunching the app, which iOS doesn't allow. - **`POST /receipt` / `/drawer`:** network receipt printers only (there's no USB printing on iPad). - **`POST /print`** goes to the AirPrint printer chosen in Settings without a dialog; with no printer chosen it fails with `print-failed`. - **`POST /screen` `{"on":false}`** shows black and turns the brightness down; `on: true` restores it. - The kiosk keeps the API running only while Emda is in the foreground (iOS suspends background apps); run it with Guided Access or Single App Mode. --- # Getting started ## Install Download Emda for Windows, Android or iPad from [emda.io](https://emda.io) and open it. A three-step wizard asks for the page to show and an admin PIN, then starts the kiosk. ## Open Settings Tap five times quickly in a top corner of the screen (or press Ctrl+Shift+Alt+A on Windows), then enter the PIN. Settings is grouped like the iPad's: Website & browsing, Appearance, Idle & screensaver, Schedule & Shabbat, Security & lockdown, Devices, Remote API, Setup & backup, Emda Pro, Diagnostics and General. ## Lock it down - **Windows**: turn on **Security & lockdown → Lock the device to Emda** (and **Start Emda automatically**). Emda locks its own window. To also block the Windows key, Alt+Tab and Ctrl+Alt+Del, run it under Windows' kiosk mode: see [Windows kiosk setup](https://emda.io/docs/windows-kiosk-setup). - **Android**: turn on **Security & lockdown → Lock the device to Emda**. For a full lock, make Emda the device owner once, with a computer, on a freshly reset tablet. See [Android kiosk setup](https://emda.io/docs/android-kiosk-setup). - **iPad and iPhone**: iOS does the locking, so there's no switch: Guided Access on any iPad (Emda's Settings show how, step by step), or Single App Mode on iPads managed by an MDM, which Emda uses by itself. See [iPad kiosk setup](https://emda.io/docs/ipad-kiosk-setup). ## Set up many kiosks Configure one kiosk, then **Setup & backup → Show setup QR code**. On each new kiosk, scan the QR code in the wizard or paste the code. Settings files and a web address of a settings file work too, so an IT team can keep one file for a whole branch. ## Licences The free version needs no licence. On iPad and Android, subscribe to **Emda Pro** or **Emda Ultra** in Settings → Emda Pro. For a licence key instead (Windows, or many devices at once), open **Emda Pro** in Settings, note the **device ID** (also under Diagnostics) and send it with your order. You get a licence key (and a QR code) for your devices: enter or scan it in Emda Pro, include it in a setup code, or send it with the Remote API. Keys are checked on the device, with no internet needed. A key only works on the devices it lists, so one setup code can carry it to a whole branch. Paid licences keep working for 14 days after they expire. ## Connect your systems - **Your website** can use `window.Emda` to print, print receipts, open the cash drawer and read the scale: see [Page API](https://emda.io/docs/page-api). - **Your server or IT tools** can control kiosks on the local network: see [Remote API](https://emda.io/docs/api). - **Using an AI coding agent?** See [AI agents](https://emda.io/docs/ai-agents) for the files and rules to give it. --- # Features Emda turns a Windows PC, an Android tablet or an iPad into a kiosk: one website (or your own local pages) on screen, locked so visitors can't leave it, and managed from a PIN-protected Settings screen. This page lists everything Emda can do and where the platforms differ. ## The kiosk | Feature | What it does | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | Home page | Any web address, or your own local pages at `emda://local/` | | Lockdown | Full screen, can't be closed or switched away from; restarts itself and starts at sign-in | | Hidden admin access | Five quick taps in a top corner (or Ctrl+Shift+Alt+A on Windows), then the PIN | | Return to start when idle | Back to the home page after a visitor walks away, with an optional "Still there?" countdown; can clear the session | | Auto refresh | Reloads the home page every few minutes while nobody is using it | | Screensaver | A clock or a slideshow of your images when idle | | Offline screen | A friendly screen when the internet drops, and back to the page when it returns | | Shabbat & holidays | From candle lighting until havdalah (by city, Jewish calendar): a message or a dark screen | | Screen-off hours | Turns the screen dark on a weekly schedule | ## Websites and browsing | Feature | What it does | | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | | Allowed / blocked sites | Keep visitors on your sites; the home page is always allowed | | Links to other apps | Choose which kinds of links (phone, mail, …) may open; everything else stays blocked | | Pop-ups | Open in the same window instead of new ones | | Local network switches | Allow or block pages from reaching this device (localhost) and the local network (LAN) | | Restrictions | Disable touch (display only), scrolling, scroll bounce, text selection, zoom, double-tap zoom, swipe back/forward | | Camera & microphone | Allow or block them for pages, and choose the camera | | Custom user agent | Present the kiosk to sites as a specific browser | | Privacy | Clear history, cache or cookies from Settings | | Navigation bar | Back, forward, home and reload buttons above the page | | Page zoom | Make every page bigger or smaller | | Bookmarks | A menu of your chosen pages | | Custom CSS & JavaScript | Your own styles and scripts on matching pages (hide a cookie banner, enlarge text, …) | | Client certificates | Log in to sites that require a certificate, automatically and without a picker; trust your internal CA for your own servers | ## Local content Show your own HTML site (an `index.html` with its CSS, scripts, images and videos) from the private address `emda://local/`, with no internet. It behaves like a normal site: scripts can load their data files, pages can save data, and videos can be skipped forward. | Feature | What it does | | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | Add from the device | Choose a .zip (or a folder on Windows and iPad) in Settings | | Keep it up to date from an address | Emda downloads a .zip address, checks it for changes and updates every kiosk with these settings | | Upload over the network | `PUT /api/v1/content` with the .zip ([Remote API](https://emda.io/docs/api)) | A .zip may hold the site at the top or inside one folder. Bad or unsafe files are refused and the old content stays. ## Printing and devices | Feature | What it does | | --------------------------------- | ------------------------------------------------------------------------------------------------- | | Printing | `window.print()` from the page, silently to the chosen printer (or with the print dialog) | | Print a page by address | `Emda.printUrl(url)` renders another page and prints it | | Receipt printers | ESC/POS receipt printers (58 / 80 mm): print HTML receipts from the page or the API, with cutting | | Cash drawer | Open the drawer connected to the receipt printer, from the page, the API or Settings | | Weighing scale | SHEKEL (Beaver) and Wintec scales, read live by the page through `Emda.scale` | ## Integration | Feature | What it does | | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | Page integration | `window.Emda` for your site: device info, navigation, printing, receipts, the scale ([Page API](https://emda.io/docs/page-api)) | | Remote API | Control kiosks over the local network: status, screenshots, open pages, messages, screen off, settings, licence, local content ([Remote API](https://emda.io/docs/api)) | ## Setup and management | Feature | What it does | | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- | | First-run wizard | The page to show and an admin PIN, then start | | Setup codes | Copy one kiosk's settings to others with a QR code or a short code, or from a settings file or web address | | Diagnostics | Internet check, device ID, internal and external IP address, DNS lookup and port check | | Send feedback | A short form from Settings straight to us | | Hebrew and English | Full right-to-left Hebrew and English | | Branding | Your business name and logo on Emda's screens, your own menu button, and the app icon | ## Platform differences | | Windows | Android | iPad | | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | | Lockdown | Built in; add Assigned Access or Shell Launcher to also block the Windows key and Ctrl+Alt+Del ([guide](https://emda.io/docs/windows-kiosk-setup)) | Full lock as the device owner, set once with a computer ([guide](https://emda.io/docs/android-kiosk-setup)) | Guided Access, or Single App Mode with an MDM ([guide](https://emda.io/docs/ipad-kiosk-setup)) | | Printing | Any installed printer, silently | Network (IPP) printers, silently | AirPrint | | Receipt printers | Network or USB | Network or USB | Network | | Weighing scale | Serial / USB (COM port) or network | USB-to-serial adapter (OTG), built-in serial port, or network | Network: the scale, or a serial-to-network adapter | | Local content | .zip or folder | .zip | .zip or folder | | App icon | Your own image | 10 built-in icons | 10 built-in icons | | Remote API | ✓ | ✓ | ✓ (while Emda is on screen; "restart" reloads instead) | On iPad, the site rules and local network switches apply to the pages visitors open, but not to images and scripts inside a page. --- # Setting up a Windows kiosk with Emda Emda locks itself down on its own: full-screen kiosk window, always on top, can't be closed, common shortcuts blocked (Alt+F4, Ctrl+W, DevTools, F11, printing, the menu bar), and it takes focus back if something steals it. It also restarts itself after a crash and starts at sign-in. Some things only Windows can stop: **Ctrl+Alt+Del, Alt+Tab, the Windows key, swipe-in gestures from the screen edges and the lock screen**. For a public kiosk, combine Emda with one of the Windows options below. Pick the lightest one that fits the location. > Windows editions differ in which kiosk features they offer, and Microsoft changes them between > releases. Treat the steps below as a guide and **verify them for your Windows edition and > version** against Microsoft's documentation: > [Configure kiosks and restricted user experiences](https://learn.microsoft.com/windows/configuration/assigned-access/). ## 1. Basic: dedicated user, auto sign-in, Emda at start-up Good for staffed locations (reception desks, shop counters) where nobody will try hard to break out. 1. Create a local standard (non-admin) user, e.g. `kiosk`: **Settings → Accounts → Other users → Add account → I don't have this person's sign-in information → Add a user without a Microsoft account.** 2. Sign in as `kiosk`, install Emda, open it once and finish setup (home page + admin PIN). 3. In Emda: **Settings → Security & lockdown**, leave **Lock the device to Emda** and **Start Emda automatically** on. Emda registers itself to start at sign-in. 4. Turn on automatic sign-in for `kiosk` so the PC comes back to Emda after a power cut. Windows hides this option on some editions and with Windows Hello; check Microsoft's current guidance for your version, or use your device-management tool (Intune, Group Policy) to configure it. 5. Optional, recommended: in the touch keyboard and gesture settings, turn off edge swipes if your Windows version offers it. What visitors can still do: Ctrl+Alt+Del (sign out / Task Manager), Alt+Tab, the Windows key. ## 2. Windows kiosk mode (Assigned Access) Windows 11 Pro, Enterprise and Education include **Assigned Access**, which signs a kiosk account straight into one app (or a short list of apps) and removes the Start menu, taskbar and most escape routes. - **Settings path:** Settings → Accounts → Other users → **Set up a kiosk** (wording varies by version). - **Single-app kiosk** through Settings traditionally only offers Microsoft Edge and Store (UWP) apps. Emda is a classic desktop app, so it may not appear in that list. - **Multi-app / restricted user experience** (configured through Intune, Windows Configuration Designer or an XML file) can allow desktop apps like Emda, with Emda set to start automatically. Because what's available depends heavily on edition and version, follow Microsoft's guide for your setup: [Assigned Access overview](https://learn.microsoft.com/windows/configuration/assigned-access/). When using Assigned Access, keep **Lock the device to Emda** on; the two layers complement each other. ## 3. Shell Launcher (Enterprise, Education, IoT Enterprise) **Shell Launcher** replaces Windows Explorer with Emda for the kiosk account, so there's no desktop, Start menu or taskbar at all. If Emda exits, Shell Launcher can restart it or restart the PC. - Available on Windows Enterprise, Education and IoT Enterprise editions (not Home or Pro). - Set up through Intune, Windows Configuration Designer, or the Shell Launcher WMI/CSP interfaces. The exact steps and the available restart actions are documented by Microsoft; see the [assigned access and Shell Launcher docs](https://learn.microsoft.com/windows/configuration/assigned-access/). Point the shell at the installed `Emda.exe` (by default under `C:\Program Files\Emda\`). ## 4. Power settings Emda keeps the display awake itself, including during screen-off hours and Shabbat (it needs to come back on time; a sleeping display only wakes on input). Still set Windows so it never interferes: - **Settings → System → Power:** Screen: _Never_; Sleep: _Never_ (on battery and plugged in). - Turn off the lock screen timeout / screen saver for the kiosk account. - In the BIOS/UEFI, set **Restore on AC power loss: Power On**, so the PC boots by itself after an outage. Combined with auto sign-in (or Shell Launcher), Emda is back without anyone touching it. - Pause or schedule Windows Update restarts outside opening hours. ## 5. How admins get out 1. Tap the **top-left or top-right corner of the screen 5 times quickly**, or press **Ctrl+Shift+Alt+A** on a keyboard. 2. Enter the **admin PIN**. 3. In Settings: - Change settings and tap **Save** to go back to the kiosk. - Turn off **Security & lockdown → Lock the device to Emda** to work on the PC with Emda still running. - Tap **Exit Emda** (and confirm) to unlock and close Emda completely. Five wrong PINs lock the PIN pad for 30 seconds, doubling each time. ## Notes - Lockdown only applies to installed (packaged) builds. Running Emda from source never locks the machine, so developers can't get stuck. - Emda can't detect whether Assigned Access or Shell Launcher is configured; its **Status** row shows whether Emda's own lockdown is active. --- # Setting up an Android kiosk with Emda For a real kiosk, make Emda the tablet's **device owner**. It's done once, with a computer, on a freshly reset tablet. Without it, Android only offers screen pinning, which visitors can undo. | | As device owner | Screen pinning only | | -------------------------------------------- | ------------------------------------- | ---------------------------------------------- | | Leaving the kiosk | Impossible without the admin PIN | Visitors can hold Back and Overview to unpin | | Home, recent apps, notifications, status bar | Blocked | Mostly blocked; Android shows a pinning notice | | Lock screen | Off | On | | After a restart | Emda starts by itself and locks again | The tablet starts normally | | Screen | Stays on while charging | Follows the tablet's settings | | Camera and microphone prompts | Granted in advance | Asked once | In both cases, admins open Emda's Settings the usual way: five quick taps in a top corner of the screen, then the PIN. ## 1. Make Emda the device owner (recommended) Android only allows this on a tablet with **no accounts** on it, so start from a new or freshly reset tablet. ### On the tablet 1. Reset it (**Settings → System → Reset options → Erase all data**), or use a new one. 2. In the setup wizard, connect to Wi-Fi, but **skip adding a Google account** (and any other account). You can add one later. 3. Turn on developer options: **Settings → About tablet**, tap **Build number** seven times. 4. Turn on **Settings → System → Developer options → USB debugging**. ### On a computer You need Android's `adb` tool ([Platform Tools](https://developer.android.com/tools/releases/platform-tools) from Google, for Windows, Mac or Linux). 1. Connect the tablet by USB and allow the computer when the tablet asks. 2. Install Emda (the Play Store needs an account, so install the APK): ```sh adb install Emda.apk ``` 3. Make Emda the device owner: ```sh adb shell dpm set-device-owner io.emda.app/.KioskAdminReceiver ``` It answers `Success: Device owner set to package io.emda.app`. ### Back on the tablet 1. Open **Emda**, enter the home page and an admin PIN. 2. In **Settings → Security & lockdown**, keep **Lock the device to Emda** and **Start Emda automatically** on. The Status row shows **Locked**. 3. Turn off **USB debugging** again. You can add a Google account now if you need one. Emda is now the tablet's home screen: Home, recent apps, notifications, the status bar and the lock screen are gone, the screen stays on while charging, and after a restart the tablet goes straight back into the kiosk. ### If `dpm set-device-owner` fails - **"already some accounts on the device"**: an account was added. Remove all accounts in Settings (or reset the tablet) and try again. - **"already several users"** or **"already provisioned"**: the tablet has more than one user, a work profile, or another device owner. Reset it. - **"Unknown admin"**: Emda isn't installed yet, or the name was mistyped. ## 2. Screen pinning (no computer) If you can't use a computer, Emda can still pin itself: 1. Turn on **Settings → Security → App pinning** (also called screen pinning; the place varies by brand). 2. Open Emda and turn on **Settings → Security & lockdown → Lock the device to Emda**. Android asks to pin the app: confirm. Visitors can still unpin by holding **Back** and **Overview** together, so use this only where staff are nearby. Emda's Status row shows **Setup needed** to remind you. ## How admins get out 1. Tap a top corner of the screen **five times quickly**, then enter the **PIN**. 2. In Settings: - Change settings and tap **Save** to go back to the kiosk. - Turn off **Security & lockdown → Lock the device to Emda** to use the tablet with Emda still running. - Tap **Exit Emda** (and confirm) to unlock and give Home back to the normal launcher, until Emda is opened again. ## Removing the device owner Android doesn't let a device owner be removed from Settings, and Emda doesn't offer it yet. To return the tablet to normal use, reset it (**Erase all data**). Use **Exit Emda** if you only need the tablet for a while. ## With an MDM Android Enterprise MDMs (for example Intune, Hexnode, ManageEngine or Scalefusion) have their own kiosk ("dedicated device") mode. Add Emda (`io.emda.app`) as the kiosk app there instead of making it the device owner; Emda's own lockdown then doesn't need to be on. ## Tips - Keep the tablet charging; as device owner Emda keeps the screen on while it's plugged in. - Turn off automatic system updates that restart the tablet during opening hours, or schedule them. - Menu names differ slightly between brands and Android versions. --- # Setting up an iPad kiosk with Emda On iPad (and iPhone), iOS itself does the locking: Apple doesn't let any app lock the device on its own. Pick one of three ways, depending on whether your iPads are managed by an MDM: | | Needs | After a restart | Who unlocks | | ------------------------------ | ----------------------------- | ----------------------------------- | ---------------------------------------- | | **Guided Access** | Any iPad, nothing extra | Start it again in Emda | Whoever knows the Guided Access passcode | | **Autonomous Single App Mode** | A supervised iPad with an MDM | Emda locks itself again when opened | An admin, from Emda's Settings (PIN) | | **Single App Mode** | A supervised iPad with an MDM | The iPad starts straight into Emda | IT, from the MDM | In every mode, admins open Emda's Settings the usual way: five quick taps in a top corner of the screen, then the PIN. ## 1. Guided Access (any iPad) ### Turn it on (once) 1. Open **Settings → Accessibility → Guided Access** and turn **Guided Access** on. 2. Tap **Passcode Settings → Set Guided Access Passcode** and choose a passcode. Use a different one from the iPad's own passcode, and keep it with the admin PIN. You can also allow Face ID or Touch ID to end Guided Access. 3. Set **Display Auto-Lock** (on the same screen) to **Never**, so the screen stays on. 4. Optional: **Settings → Accessibility → Accessibility Shortcut → Guided Access**, so a triple-click goes straight to Guided Access. ### Start the kiosk 1. Open **Emda**, with the page visitors should see. 2. **Triple-click the top button** (the Home button on iPads that have one). 3. Tap **Options** (bottom left) and turn off **Side Button** (so visitors can't put the iPad to sleep), **Volume Buttons** and **Keyboards** if you don't need them. Leave **Touch** on. 4. Tap **Start** (top right) and enter the Guided Access passcode if asked. The iPad now stays in Emda: the Home gesture, the app switcher, Control Center and notifications are blocked. ### Stop it Triple-click the top (or Home) button, enter the Guided Access passcode, and tap **End** (top left). > Guided Access ends when the iPad restarts. After a restart (or a dead battery), open Emda and > start it again. For kiosks that must come back by themselves, use an MDM (below). ## 2. Autonomous Single App Mode (supervised iPads with an MDM) With this, Emda locks the iPad itself whenever the kiosk page is showing, with no triple-click or separate passcode, and locks it again after a restart as soon as it opens. 1. In your MDM (for example Jamf, Intune, Mosyle or Kandji), supervise the iPads and install a **Restrictions** profile that allows **Emda** (`io.emda.app`) to use **Autonomous Single App Mode**. 2. Open Emda. It locks by itself; **Settings → Security & lockdown → Status** shows **Locked**. There's no switch to turn on: iOS decides, based on the profile. 3. To unlock, an admin opens Settings (five taps and the PIN) and taps **Unlock this iPad**. It stays unlocked until Emda is opened again, or until **Lock now**. Without the profile, iOS doesn't let Emda lock the iPad; use Guided Access instead. ## 3. Single App Mode (MDM) Your MDM can lock a supervised iPad to one app ("Single App Mode" or "App Lock", depending on the MDM), with Emda's bundle ID `io.emda.app`. The iPad then starts straight into Emda, even after a restart, and only the MDM can release it. Nothing to set in Emda. ## Tips - Keep the iPad on its charger. Emda keeps the screen awake while it's open (**Appearance → Keep screen on**); also set **Settings → Display & Brightness → Auto-Lock** to **Never**. - Turn on a **Focus** (Do Not Disturb) so no sounds or calls interrupt the kiosk. - If the kiosk uses the camera, microphone or local network (Remote API, receipt printers), allow them when iOS asks the first time, before you start Guided Access. - Your Guided Access options are remembered for Emda, so the next start is just a triple-click and **Start**. --- # TypeScript types for window.Emda (https://emda.io/emda.d.ts) ```ts /** * Types for `window.Emda`: the API that Emda kiosks give to the pages they show. * Docs: https://emda.io/docs/page-api · For AI agents: https://emda.io/llms-full.txt * * `window.Emda` is undefined outside Emda, and each part only exists when it's turned on in the * kiosk's Settings: page integration (version, device info, print, navigation), the receipt * printer (`receipt`) and the scale (`scale`). Always feature-detect. */ export {}; declare global { interface Window { Emda?: Emda.Api; } interface WindowEventMap { /** Fired once when `window.Emda` is ready (if it exists at all on this kiosk). */ 'emda:ready': Event; } namespace Emda { type Result = { ok: true } | { ok: false; error: E }; interface DeviceInfo { /** Stable per install; Settings → Diagnostics shows a short form. */ deviceId: string; appVersion: string; platform: string; } type PrintError = 'unavailable' | 'printing-disabled' | 'not-licensed' | 'blocked' | 'print-failed'; type ReceiptError = | 'receipt-disabled' | 'not-licensed' | 'blocked' | 'printer-unreachable' | 'printer-failed' | 'render-failed'; interface ReceiptOptions { /** Override the kiosk's "cut after printing" setting. */ cut?: boolean; /** Override the kiosk's "open the cash drawer" setting. */ openDrawer?: boolean; } interface Receipt { /** * Prints HTML on the ESC/POS receipt printer. It's drawn at paper width (58 mm = 384 CSS px, * 80 mm = 576 CSS px), black on white. Scripts inside it don't run. */ print(html: string, options?: ReceiptOptions): Promise>; /** Loads a page at paper width (with the kiosk's cookies) and prints it. */ printUrl(url: string, options?: ReceiptOptions): Promise>; /** Opens the cash drawer on the receipt printer's drawer port. */ openDrawer(): Promise>; } type ScaleStatus = 'stable' | 'repeated' | 'unstable' | 'zero' | 'negative' | 'overweight' | 'unknown'; interface ScaleReading { status: ScaleStatus; statusRaw?: string; /** Kilograms. */ weight: number; hasWeight: boolean; stable: boolean; overweight: boolean; underweight: boolean; /** The scale's raw reply, for logging. */ raw: string; } type ScaleErrorCode = | 'not_connected' | 'not_licensed' | 'timeout' | 'bad_response' | 'bad_request' | 'not_supported' | 'cancelled'; /** Scale methods reject with this. */ interface ScaleError { code: ScaleErrorCode; /** HTTP-like status: 503, 402, 504, 502, 400, 501, or 0 for cancelled. */ status: number; message: string; } interface WaitForStableOptions { /** Default 30000. */ timeoutMs?: number; /** Default 400. */ intervalMs?: number; /** Called on every poll with the reading, or null and an error code. */ onReading?: (reading: ScaleReading | null, errorCode: ScaleErrorCode | null) => void; } interface Scale { getWeight(): Promise; /** stable && hasWeight && in range && weight > 0 */ isUsableReading(reading: ScaleReading | null | undefined): boolean; /** Polls until a usable reading or the timeout. */ waitForStable(options?: WaitForStableOptions): { promise: Promise; cancel(): void }; zero(): Promise; /** Kilograms. */ setTare(kg: number): Promise; clearTare(): Promise; /** SHEKEL only. */ setUnitPrice(unitPrice: number): Promise; /** SHEKEL only. */ getTotal(): Promise<{ success: boolean; totalPrice: number; raw: string }>; getFirmware(): Promise<{ firmwareId: string }>; } interface Api { /** Always true once the object exists. */ ready: true; /** Page integration only (Settings → Remote API → Allow page integration). */ version?: string; getDeviceInfo?(): Promise; /** Same as window.print(): follows the kiosk's printing settings (silent or dialog). */ print?(): void; /** Renders another page and prints it on the normal printer. */ printUrl?(url: string): Promise>; home?(): void; reload?(): void; back?(): void; forward?(): void; /** Only when the receipt printer is on. */ receipt?: Receipt; /** Only when the scale is on. */ scale?: Scale; } } } ```