Atlas Device SDK for C++
Use Atlas Device SDK for C++ to write applications that access data stored locally on devices and sync data with Atlas.
Get Started with the C++ SDK
![Functions Icon](/docs/atlas/device-sdks/images/icons/branding_2022/Technical_ATLAS_Functions3x.png)
Quick Start
Minimal-explanation code examples of how to work with the C++ SDK, write to the device database, and sync with other devices.
![Atlas Device SDK Mobile Icon](/docs/atlas/device-sdks/images/icons/branding_2022/Technical_REALM_Mobile3x.png)
Working Example App
Learn from a working terminal GUI client app that uses the C++ SDK.
![Tutorial Icon](/docs/atlas/device-sdks/images/icons/branding_2022/General_CONTENT_Tutorial3x.png)
Guided Tutorial
Follow a guided tutorial to learn how to adapt the example app to create your own working app.
Develop Apps with the SDK
Use the SDK's open-source database - Realm - as an object store on the device. Use Device Sync to keep data in sync with your MongoDB Atlas cluster and other clients.
Install the C++ SDK
Use Swift Package Manager or Cmake to Install the C++ SDK in your project.
Include the header in the translation unit where you want to use it to get started.
Define an Object Schema
Use C++ to idiomatically define an object type.
Open a Database
The SDK's database - Realm - stores objects in files on your device. Configure and open a database to get started reading and writing data.
Read and Write Data
Create, read, update, and delete objects from the database. Filter data using the SDK's query engine.
React to Changes
Live objects mean that your data is always up-to-date. You can register a notification handler to watch for changes and perform some logic, such as updating your UI.
![Atlas Device SDK Mobile Illustration](/docs/atlas/device-sdks/static/a142cbd5221d3bf0be5b10b3a88b17cb/241a1/Technical_SOFTWARE_Connect(2)_Spot.webp)
Connect to an Atlas App Services App
Configure Device Sync in an App Services App. Define data access rules. Use Development Mode to infer your schema from your C++ data model.
Then, connect to the backend from your client.
Authenticate a User
Use one of our authentication providers to authenticate a user. App Services provides access to popular authentication providers, such as Apple, Google, or Facebook. Use our built-in email/password provider to manage users without a third-party, or use custom JWT authentication to integrate with other authentication providers. Anonymous authentication provides access without requiring a login or persisting user data.
Open a Synced Database
Configure and open a synced database. Subscribe to a query to determine what data the synced database can read and write.
Read and Write Synced Data
The APIs to read and write data are the same whether you're using a synced or non-synced database. Data that you read and write to the device is automatically kept in sync with your Atlas cluster and other clients. Apps keep working offline and deterministically sync changes whenever a network connection is available.
![Device Sync Illustration](/docs/atlas/device-sdks/static/3663e76ec7a23581c327070edf06db05/dab22/Technical_SOFTWARE_Sync(2)_Spot.webp)
Call Serverless Functions
You can call serverless Functions from your client application that run in an App Services backend.
Authenticate Users
Authenticate users with built-in and third-party authentication providers. Use the authenticated user to access App Services.
![App Services Illustration](/docs/atlas/device-sdks/static/292f9c683e68aeabfeae94ade95b9dba/241a1/Technical_ACTION_WrenchSettings_Spot.webp)
Recommended Reading
![Functions Icon](/docs/atlas/device-sdks/images/icons/branding_2022/Technical_ATLAS_Functions3x.png)
![SDK Icon](/docs/atlas/device-sdks/images/icons/branding_2022/Technical_REALM_SDK3x.png)
![SDK Icon](/docs/atlas/device-sdks/images/icons/branding_2022/Technical_REALM_SDK3x.png)