# Data and privacy

> What a checkup sends off the device in both SDKs, and what the checkups' own libraries send.

What a checkup sends off the person's device, in both SDKs, and what the libraries some checkups
embed send on their own. Your privacy policy, the App Store's privacy details and Google Play's
Data safety form need it: [App Store and Google Play](/docs/sdks/app-stores#say-what-happens-to-the-data)
says how to fill them in.

## What the SDKs send

This is every connection the SDKs make themselves, as the Flutter SDK makes it; the Web SDK
differs on a few points, [listed below](#where-the-web-sdk-differs). What the checkups' libraries
send on their own is in [the next section](#what-the-checkups-libraries-send).

| Connection                                                                                        | What it sends                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | What it never sends                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Starting the SDK** opens a session with YOU(th)                                                 | Your key, `delivery: native`, the platform (`ios` or `android`) and the SDK's version. With `initWithSessionProvider`, your backend opens the session with your key and sends these fields itself, and your app holds only a short-lived session token. Every later connection to YOU(th) carries the session's token, never the key                                                                                                                                                                                                                                                                                                                                                                                                                         | Anything about the person                                                                                                                                                                                    |
| **A face video measurement**, model 1 or model 2                                                  | First it asks YOU(th) for a scan: which model, and whether the person asked to measure or the SDK prepared the scan ahead. YOU(th) answers with a random id for the scan and the credential the model's library starts with. Then it reports the scan's status under that id, with the model's name: `started`, then `completed` or `failed`. That is how checkups are counted                                                                                                                                                                                                                                                                                                                                                                               | The video or any frame of it, the details you pass in about the person, or anything else about them. The results are worked out on the device and handed to your app; they leave it only to be scored, below |
| **A voice checkup**                                                                               | The person's year of birth and gender, and which voice checkup it is (respiratory or mental fitness). Then the recordings. Then it asks YOU(th) to analyse them, under an id YOU(th) gave the checkup, and asks for the results until they are ready                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Anything else about the person                                                                                                                                                                               |
| **A selfie checkup**                                                                              | One photo of the person's face, once they submit it. Then it asks for the results until they are ready. YOU(th) passes the photo on to the analysis under an id made for that checkup alone, with nothing that names the person, and keeps no photo. YOU(th) asks the analysis to delete the photo and its results as soon as the results are ready. An hourly job asks again when that deletion failed, and for a checkup that never finished, from two hours after it was made. It retries until the deletion succeeds, a limited number of checkups each run, and waits while a photo is still being uploaded, so a photo can stay with the analysis longer when the analysis cannot be reached. YOU(th) keeps the results for a day, for the SDK to read | Anything else about the person. The SDK keeps the photo in memory only, never in a file                                                                                                                      |
| **A body composition checkup**                                                                    | The person's sex, year of birth (worked out from their age), height and weight, once the capture is done, which makes the checkup. Then the video of their body, which the capture writes to a file on the device: the SDK deletes the file once it is uploaded, or when the checkup ends. Then it asks for the results until they are ready. YOU(th) passes the profile and the video on to the analysis under an id made for that checkup alone, with nothing that names the person, and keeps neither                                                                                                                                                                                                                                                     | Anything else about the person, such as a `userId` you pass in                                                                                                                                               |
| **YOU(th)'s scores**, only when your app passes `onFinalScores` and your organization gets scores | After a checkup's results: the person's age and sex (`female` or `male`), and the code and value of every biomarker the checkup returned, scored or not (such as `heart_age`), except `hemoglobin` and `hba1c`, whose estimates go as `hemoglobin_index` and `hba1c_estimate`. YOU(th) answers with the scores, and keeps neither them nor what it was sent                                                                                                                                                                                                                                                                                                                                                                                                  | The person's other details, the video, photo or recordings, or anything that names the person                                                                                                                |
| **Error reports** of errors in the SDK's own code, and of the errors it gives your app            | The error's type; its stack frames, the SDK's own with their file, function and line, any other package's reduced to the package's name; the SDK's version; the platform (`ios` or `android`); the step the SDK was at; the error code your app was given and the checkup it came from; the stage of YOU(th)'s service; whether your key is a test or a live key; and a random id and the time of the report. The SDK rebuilds each report from these fields alone before it leaves the device                                                                                                                                                                                                                                                               | The error's message, the person, your key, a session token, a scan, a result, or anything about the device beyond the platform. No record of what happened before the error                                  |

The Web SDK makes a body composition checkup before its capture rather than after it: see
[below](#where-the-web-sdk-differs).

YOU(th)'s servers see the device's IP address with each request and keep it in their request logs;
the error reports don't store it.

### Error reports

- **They are about the SDK only.** The SDK keeps its own error reporting, apart from your app's: it
  never reads or changes your app's error reporting, and never reports an error from outside the
  SDK.
- **The same error is sent at most once a minute,** so an error that repeats in a loop sends one
  report a minute.
- **They go to a service hosted in the EU,** which does not store the device's IP address. The
  reports also tell it not to work out where the device is from that address.
- **You can turn them off.** `diagnostics: false` when you start an SDK turns them off, and so do
  [your organization's settings](/docs/sdks#your-organizations-settings) when you leave
  `diagnostics` out. YOU(th) recommends leaving them on: they are how YOU(th) sees a checkup fail in
  your product.

### Where the Web SDK differs

- **The session** sends, besides your key and the SDK's version, how the checkup is shown: in an
  iframe, with `web` and the origin of the page that embeds it; in an app's web view, with `ios` or
  `android` when the app says which; or in a Custom Tab, with `android` and the address the result
  goes back to.
- **A body composition checkup** sends the person's sex, year of birth, height and weight once
  they press Start, which makes the checkup. Then the video of their body, once recorded: it is
  held in memory only, never in a file or the browser's storage. Then it asks for the results until
  they are ready. YOU(th) holds the profile until the video arrives, then passes the profile and the
  video on to the analysis under an id made for that checkup alone, with nothing that names the
  person, and keeps neither. When no video comes, the profile is never passed on, and YOU(th)
  deletes it within about two hours. It never sends your `user`'s other fields. With the
  results, it reads the body's 3D model and its picture, which YOU(th) passes on from the
  analysis without keeping them, and it shows them in memory only. A Future Me sends the target
  weight the person picks, which YOU(th) keeps with the checkup for a day; the analysis deletes the
  model, the scan and the Future Mes within about two hours.
- **YOU(th)'s scores** are asked only when your page passes `onScores`, or sends `scores: true` in
  `init`, and your organization gets scores. After a result, the checkup sends the person's age and
  sex (`female` or `male`) and the code and value of each biomarker the scoring takes, nothing of
  the person besides. YOU(th) answers with the scores, and keeps neither them nor what it was sent.
- **A face video model's licence check** can go through YOU(th) on a network that blocks the
  library's licence servers, as [the next section](#what-the-checkups-libraries-send) says. YOU(th)
  then passes on the library's own licence request and its answer.
- **Error reports** also carry the browser and its major version, the system (such as `ios`,
  `android` or `windows`), the kind of device (phone, tablet or desktop), how the checkup is shown,
  the origin of the page that embeds it, the model in use, the checkup's phase, the code of what
  caused the error, whether the page was visible and online, and how long it had been open, in
  broad ranges. Every frame keeps its function and line, and its script's path without the host. A
  report is also sent when the checkup's page stops responding. With `diagnostics` left out, the
  reports are on until your key is accepted, and your organization's setting decides after that.

The SDKs hold no analytics or advertising library and do not track people across apps or sites.

## What the checkups' libraries send

Some checkups run a library of the company whose technology measures them. Here is what each sends
on its own, besides what the SDKs send:

| Checkup                    | What its library sends on its own                                                                                                                                                                                                                                                                                                                                                                                                                        | Can you turn it off?                                                                                                                  |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Face video, model 1        | It checks its licence online when a scan opens, and sends nothing else. In the Web SDK, on a network that blocks its licence servers, that check goes through YOU(th). Its optional usage analytics stay off                                                                                                                                                                                                                                             | No: a scan does not start without its licence                                                                                         |
| Face video, model 2        | It checks its licence online when a scan opens, and sends its own crash reports and diagnostics (measurement events, timings, device and signal-quality information), with an identifier of the device. It gets nothing about the person: no age, height, weight, sex or smoking status, and no user id. Its local history, its video recording and its own screens are off. Its diagnostics may include measurement values: declare them as health data | No. Run model 1 only if you don't want it: in the Flutter SDK, install `youth_sdk_face_video_1`, which leaves model 2 out of your app |
| Voice                      | Nothing: the recordings go to YOU(th) only                                                                                                                                                                                                                                                                                                                                                                                                               | Nothing to turn off                                                                                                                   |
| Selfie                     | Nothing: its face detection runs on the device and sends nothing. The Web SDK serves the face detector from YOU(th)'s own address, with its usage reports switched off                                                                                                                                                                                                                                                                                   | Nothing to turn off                                                                                                                   |
| Body composition (Web)     | Nothing: the Web SDK runs its capture with its usage reports taken out, and serves the model and files it loads from YOU(th)'s own address. It keeps nothing in the browser                                                                                                                                                                                                                                                                              | Nothing to turn off                                                                                                                   |
| Body composition (Flutter) | Events about its capture screen (when the capture closes, and its status), with an identifier of the device, whenever a capture runs. Its iOS privacy manifest declares them                                                                                                                                                                                                                                                                             | No. Leave the package out if you don't use the checkup                                                                                |

Model 2 runs in both SDKs. In the Flutter SDK, which models your app carries depends on its packages:

| Package                  | Carries      |
| ------------------------ | ------------ |
| `youth_sdk_face_video`   | Both models  |
| `youth_sdk_face_video_1` | Model 1 only |
| `youth_sdk_face_video_2` | Model 2 only |

## On iOS

Each Flutter package carries a privacy manifest that declares what that package collects, none of
it linked to the person or used for tracking, so App Store Connect's privacy report lists only the
checkups your app installed. Model 2's package declares health data, crash, performance and other
diagnostic data and a device identifier, for what its library sends. The camera, microphone and
on-device face detection the SDK uses collect and send nothing.
