Attested results
Tell a result Neccessory computed from one a client submitted, and check it on your backend.
Every measurement result carries origin and attested. Together they tell you who
computed the numbers.
| Mode | origin | attested | Who computed the metrics |
|---|---|---|---|
| Cloud session or video processing | "cloud" | true | Neccessory, from data received in a session or job created with your key |
| On-device | "on_device" | false | The client, which then submitted the result |
A cloud result is attested only when it is complete and its signal quality is usable. A
cloud result with poor quality or isComplete: false has attested: false.
Both fields are set by Neccessory. If a client sends them with a result, they are ignored.
What attestation proves
- The metrics were computed by Neccessory, not supplied by a client.
- The input came from a session or job created with your API key.
- The stored values are exactly the values Neccessory computed.
What it does not prove
- Identity. It does not say who was in front of the camera.
- Liveness. It does not prove that a live person was in front of the camera, or that the video was recorded at the time of the measurement.
- Medical accuracy. An attested result is still a wellness estimate. See the disclaimer.
If your use case needs identity or liveness checks, add them in your own flow.
Use it securely
Never trust a result your own client sends you. Anyone who controls the browser or the app can change it before it reaches your server. Read the result from the API on your backend instead:
- Cloud session — read
GET /sdk/v1/cloud/jobs/{sessionId}for the session your backend created for this user. See Cloud sessions. - Video processing — read the job, or take it from the job webhook.
- A measurement ID from your app — read
GET /sdk/v1/measurements/{id}and confirm it belongs to this user.
Then accept the result only if attested === true && test !== true.
app.post('/api/measurements/confirm', async (req, res) => {
const measurement = await neccessory(
'GET',
`/sdk/v1/measurements/${encodeURIComponent(req.body.measurementId)}`,
).catch(() => null);
const trusted =
measurement !== null &&
measurement.attested === true &&
measurement.test !== true &&
measurement.userRef === currentUserRef(req) &&
Date.now() - measurement.createdAt < 10 * 60 * 1000;
if (!trusted) return res.status(422).json({ error: 'untrusted_measurement' });
res.json({ heartRate: measurement.cardiac.heartRate.value });
});neccessory() is the signed-request helper from Cloud sessions.
The API returns only measurements that belong to the calling key; any other ID returns
404 not_found. Checking userRef and createdAt stops a user from presenting another
user's result or an old one.