On-device quickstart
- 1
Install
bashgit clone https://github.com/neetixai/liveliness-sdks npm i ./liveliness-sdks/packages/edgenpm i @neetix/edgeis the intended install; the registry publish is pending.The wasm binary is built, not committedThe package needs
wasm/neetix_edge.jsandwasm/neetix_edge_bg.wasm(~17 MB), which are produced bywasm-packin the engine repo and are gitignored here. A checkout without them installs cleanly and then fails to load at runtime. The package'sprepublishOnlyguard refuses to publish a tarball that is missing them, or whose.wasmis under 1 MB — that size check catches the.d.tsplaceholder being packed instead of the real binary. - 2
Load the engine
tsimport { NeetixEdge } from "@neetix/edge"; const edge = await NeetixEdge.load(); // fetches + initialises the wasm, onceThis is the only network activity in the whole flow, and it is cacheable. Do it behind a loading state — it is a multi-megabyte download on first visit.
- 3
Detect and score a frame
tsconst faces = edge.detect(videoEl); // ImageData | Canvas | Video if (faces[0]) { const live = edge.liveness(videoEl, faces[0]); console.log(faces[0].box, live.live, live.score); }detectandlivenessaccept anImageData, anHTMLCanvasElementor anHTMLVideoElement— including a livegetUserMediastream. Inputs are normalised toImageDatainternally through an offscreen canvas. - 4
Drive it from a live camera
tsconst videoEl = document.querySelector("video")!; videoEl.srcObject = await navigator.mediaDevices.getUserMedia({ video: true }); await videoEl.play(); const edge = await NeetixEdge.load(); function tick() { const faces = edge.detect(videoEl); if (faces[0]) { const live = edge.liveness(videoEl, faces[0]); setHint(live.live ? "Hold still" : "Move into better light"); } else { setHint("Center your face"); } requestAnimationFrame(tick); } tick();Prefer this shape — per-frame hints during capture — over scoring a single still. It is what stops a user submitting a frame that was always going to be rejected.
Prove it is offline
The claim is checkable, and showing it is more convincing than saying it:
- Load the page and wait for
NeetixEdge.load()to resolve. - Open DevTools ▸ Network and clear it, or turn off Wi-Fi.
- Keep using the camera. Detection and liveness keep working with no requests.
Next
- On-device overview — what ships today and what is pending.
- REST API — the hosted verdict, for when it has to be auditable.