Skip to content
DevLab

How the SDK works

The two halves of the SDK, its two modes, what you decide and why the browser carries no token.

On this page
  1. Two halves
  2. Two modes
  3. No token in the browser
  4. What you decide
  5. The pages of this group

Preview 0.45 Available · Preview 0.45. The API can change before 1.0: see Release phases.

The SDK runs the capture for you: the protocol, the steps, the batches, the baseline and the results of the session. You build the screens and decide what each step means.

The SDK is two npm packages, one per side of the wire:

  • In the browser, @neurologyca/capture: the live client (createProtocolClient) and, from @neurologyca/capture/record, the recording client (createRecordingClient).
  • In your backend, @neurologyca/capture-server: the proxy that adds the token (createEngineProxy), createEngineAdmin for people, enrolments and results, and, for deferred, the upload receiver (createUploadReceiver).
  1. Browser@neurologyca/capture
  2. Your backend@neurologyca/capture-server: proxy + token + admin + receiver
  3. Engine
The token lives only in your backend.
  • On-device (real time): processed in the browser as you capture; for short captures, results arrive during the session and seconds after the last batch, while long captures take minutes to close. Video and audio never leave the device; landmarks and expression data go to Engine, plus the transcript and extra signals only if you turn them on. Limited by the device: the face detection on the GPU (WebGL 2) and, on phones, heat in long sessions.
  • Deferred (server-side): the SDK records the video and a step manifest and uploads them; our processing service handles them shortly after. It is not hours later: it just doesn’t run on the device. Today you can record, upload and process with Neurologyca’s processing service: nothing to deploy.

Which one, and how to combine the SDK with the HTTP API: Integration paths.

Your page talks to your backend, and your backend’s proxy adds the token. Create the client with your proxy’s path and no getToken:

JavaScript
import { createProtocolClient } from '@neurologyca/capture'
const client = createProtocolClient({ baseUrl: '/engine', taxonomy }) // your proxy: no key, no token in the page

The screens and their texts; consent before captureProtocol, and only from a gesture of the person; who closes each step and what a step without text says; who your users are and which ids each one can touch (authorize with ownsAll). The SDK and capture-server do the Engine routes, the token, the batches, the retries and the reservation. The full table is in Integration paths.