NeccessoryNeccessory
Web SDK

Browser support

Supported browsers, local development setup, performance by mode and fixes for common problems.

Supported browsers

The Web SDK runs in recent versions of:

BrowserPlatforms
ChromeDesktop and Android
EdgeDesktop
FirefoxDesktop
SafarimacOS and iOS

The page must run in a secure context: HTTPS, or localhost during development. On plain HTTP the browser does not open the camera. If you embed the measurement in an iframe, add allow="camera" to the iframe.

Local development

  • Serve the page from http://localhost or http://127.0.0.1 — both count as secure.
  • Pass assetOrigin: 'https://neccessory.com' to createMeasurement() and prefetchMeasurement(). On localhost, 127.0.0.1 and *.localhost the SDK otherwise loads its runtime files from your own server, and the measurement fails to start.
  • To test on a phone, serve the page over HTTPS — for example, from a preview deployment or through an HTTPS tunnel.
  • With a test key, use delivery: 'batch' in cloud mode. Test keys return synthetic results.

Performance

Cloud modeOn-device mode
Device loadLower — the metrics are computed in Neccessory cloudUses the device CPU for the whole measurement. Older and low-end devices start slower.
First startDownloads much less than on-device modeDownloads the SDK runtime — tens of megabytes. Call prefetchMeasurement() when the page loads.
NetworkSteady upload of about 1–1.5 Mbit/s for the whole measurementUsed to load the SDK at start
Live valuesArrive with network latency, up to twice per secondComputed on the device
ResultArrives after the measurement ends and is already storedAvailable immediately after stop(); your backend stores it

On a weak connection, cloud mode with delivery: 'auto' finishes the measurement by upload and still returns a result.

Troubleshooting

SymptomCauseFix
The camera does not open; load_failed after requestingCameraCamera permission denied, the camera is used by another app, the page is not on HTTPS, or an iframe lacks allow="camera".Ask the user to allow camera access in the browser settings and close other apps that use the camera. Serve the page over HTTPS.
Stuck on loadingModels, or load_failed after itThe network or your CSP blocks cdn.jsdelivr.net or neccessory.com.Allow both hosts — see Requirements.
The measurement fails to start on localhostThe SDK loads its runtime files from your local server.Pass assetOrigin: 'https://neccessory.com'.
On-device mode fails to start on your domainThe model grant is missing or expired.Mint a grant on your backend for each page load and pass it as modelGrant.
cloud_unreachableA firewall, proxy or CSP blocks WebSockets.Keep the default delivery: 'auto', or use 'batch'. Allow the session's wsUrl host in connect-src.
On-device: onResult never firesOn-device mode has no automatic end.Call stop() after 30–60 seconds.
All metrics are nullThe signal quality was poor.Ask the user to face the camera in even light and hold still. Show the onCoach hints — see Signal quality.
token_expiredThe session was created more than 5 minutes before start().Create the session right before start().
session_already_usedThe same session was used twice.Create a new session for every measurement.
stream_interruptedThe user switched tabs, or the connection dropped.Keep the tab in the foreground. Use delivery: 'auto' so the SDK finishes by upload.

All error codes are listed in Callbacks & errors.