> For the complete documentation index, see [llms.txt](https://simprints.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simprints.gitbook.io/docs/development/simprints-for-developers/other-intergrations/commcare-integration/cosync.md).

# CoSync

Simprints offers two independent ways of synchronising data between devices:

1. Simprints' own backend (a.k.a. BFSID)\
   Data is synced up to Simprints' backend (currently built on the Google Cloud Platform) and then down to each device according to the project synchronisation settings.
2. CoSync\
   Data is returned back to the calling app (CommCare in this case) which takes care to synchronise it between devices according to its logic. Simprints ID can then read the data back when fulfilling identification requests.

Both synchronisation options are independent so they can be enabled together (to have double synchronisation) or only one of them can be selected.

### Vulcan Configuration

To enable CoSync you have to open the projects 'Configurations' tab in [Vulcan](https://vulcan.simprints.com/) and go the 'Synchronization' sub-tab. There you will find two dropdowns for 'Simprints sync' and 'Co sync'.

There are two types of data to be synchronised - analytics and biometrics. Analytics includes all the steps (both user- and app-driven) that were performed by Simprints ID. Biometrics is the biometric data of the enrolled subjects. For both Simprints and CoSync you can configure 'None', 'Only analytics', 'Only biometrics' and 'Everything' and any combination between the two is possible.

<figure><img src="https://2829653571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe3eCeQ95EVZnUB1IR9zM%2Fuploads%2FzyEzVLU010ij0rKI3bop%2FScreenshot%202024-06-24%20at%2018.51.07.png?alt=media&amp;token=beefb06e-e2a0-4e84-a566-0556d9337c0e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2829653571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe3eCeQ95EVZnUB1IR9zM%2Fuploads%2FcJ6LYc2GqjxWFHfFKLtH%2FScreenshot%202024-06-24%20at%2018.51.30.png?alt=media&amp;token=4d1fc866-e4d5-49d9-b5ba-d663bb1892e6" alt=""><figcaption></figcaption></figure>

(Note: Analytics for CoSync are currently being revamped so are unavailable as of v2024.1.3 of Simprints ID)

In order to use CoSync for synchronising biometric data you need to select either 'Only biometrics' or 'Everything'.

### CommCareHQ configuration

#### Saving the biometric data

In order to save the biometric data returned by Simprints ID you need to save the 'subjectActions' key from the enrolment callout response:

<figure><img src="https://2829653571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe3eCeQ95EVZnUB1IR9zM%2Fuploads%2FKVggk4xNVPIF0TJCYxEo%2FScreenshot%202024-06-24%20at%2017.36.59%20copy.png?alt=media&amp;token=6386c262-28c8-485c-b809-c6e64a904fcc" alt=""><figcaption></figcaption></figure>

#### Providing biometric data to Simprints ID

In order for Simprints ID to use CommCare as the data source for biometric data for identification callouts they need to have an extra flag 'biometricDataSource' that's set to 'CommCare':

<figure><img src="https://2829653571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe3eCeQ95EVZnUB1IR9zM%2Fuploads%2FQQAVPspgv7xL3pYnDvxS%2FScreenshot%202024-06-24%20at%2018.08.52.png?alt=media&amp;token=43c91c49-f675-4823-9649-a13ae398153e" alt=""><figcaption></figcaption></figure>

(Note: Reading biometric data from CommCare is only available from Simprints ID v2024.1.3 on)

#### Enrolment+ with CoSync

If you are going to use Enrolment+ together with CoSync then you need to set the `biometricDataSource = 'CommCare'` extra in the REGISTER callout (see [section above](https://simprints.gitbook.io/docs/development/simprints-for-developers/other-intergrations/commcare-integration/cosync#saving-the-biometric-data)), too. This is so the biometric search before enrolling a subject uses CommCare as the data source.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://simprints.gitbook.io/docs/development/simprints-for-developers/other-intergrations/commcare-integration/cosync.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
