Connect data sources
Integration of Thryve SDK takes barely more than a few minutes to connect data sources up and running including native data sources.
Assuming you have set up your mobile app project as outlined and have added the Thryve SDK via dependency management or manually via framework files, you have everything to get going to get your users to connect their data source with your application.

All data connections and data stored at Thryve are always linked to a Thryve user. A Thryve user will be automatically created or an existing user will be retrieved when initializing the SDK.
Initialize the Thryve SDK
Create the ThryveSDK instance using getOrCreate and set up the ThryveSDKConfig object according to your needs. Initializing ThryveSDK will automatically create a new Thryve user or get an existing Thryve user based on endUserAlias.
There are two versions of ThryveSDK singleton initialization. Synchronous ThryveSDK.getOrCreate() and asynchronous await ThryveSDK.getOrCreate(). It is recommended to use async version when providing new config using ThryveSDK.getOrCreate(newConfig) to ensure ThryveSDK awaits user refresh safely
context
default Android context (only relevant for Android integration)
yes
authId
Credentials to authorize your app with the Thryve backend
yes
authSecret
Credentials to authorize your app with the Thryve backend
yes
ThryveSDK.getOrCreate throws a fatalError and an InitializationException on iOS and Android respectively, that must be handled in your code. Starting from Android SDK 5.0.5, InitializationException is handled internally in the SDK and communicated in a ThryveResponse to the host application via an optional callback
Create a Thryve user
The SDK will automatically take care of creating new users. It will also take care of managing existing users when endUserAlias is set. Therefore we highly encourage usage of endUserAlias as otherwise you will need to manually manage and set the endUserId for existing users. You can retrieve the endUserId of the current user using getEndUserId method.
endUserAlias
Unique identifier for your user that can be set optionally by you. Make sure to set a secure, non-predictable, unique identifier without personal identifiable information.
Maximum length is 80 characters, only alphanumeric characters and dash (-) are supported.
no
endUserId
Identifier used to authenticate your end-user with Thryve in network requests. Only set if you don't use the endUserAlias and want to initialize the SDK for an existing user.
no
With the introduction of Thryve SDK 5.0.0 former accessToken has been renamed to endUserId and partnerUserId has been renamed to endUserAlias for improved clarity. Functionality of parameters has not changed.
To avoid iOS SDK race conditions on endUserId refresh, please, use async version of ThryveSDK.getOrCreate() singleton init. Additionally, iOS SDK provides .endUserIdDidUpdate notification implementation to catch endUserId updates if needed: NotificationCenter.default.addObserver(forName: .endUserIdDidUpdate, ...)
Set user language
The configured language is used in the UI provided by Thryve, like the Thryve Connection Widget. If not manually set by your app, the SDK will use the language set on the device.
locale
Manually set the language code following ISO 639-1 to set the language that will be used on UI elements, e.g. the Thryve Widget. If empty the SDK will get the phone's language.
no
Display the Thryve Connection Widget
Thryve Connection Widget allows your end users to connect and disconnect all enabled data sources configured for your application without you needing to implement any views or logics.
The Thryve Connection Widget will be launched as a web-view and can be implemented within any view of your application by using ThryveDataSourceConnectionWidget.
Apple Health, Health Connect, and Samsung Health will be shown in the Thryve Connection Widget only if their respective modules are imported and the data source is available on the device.
redirectURL
To automatically redirect users after connection or disconnection of web data sources, we recommend configuring a deep link. The specified redirectURI should link the user to the screen where Thryve Connection Widget is embedded within your application
no. applicable to only native, react native and Flutter Android SDKs
Module configuration options
Data source configuration
When using optional SDK modules like for Apple Health, Health Connect or Samsung Health , make sure to initialize the corresponding configurations ThryveAppleHealthConfig, ThryveHealthConnectConfig and ThryveSamsungHealthConfig for correct functionality.
configs
List of ThryveSDKModulesConfig for imported SDK modules.
yes
When using the Apple Health module, make sure to define the data types in the ThryveAppleHealthConfig . This is only relevant for iOS integration.
dataTypes
The Apple Health data types Set<ThryveAppleHealthDataType> required by your app. Ensure to limit types to data described in your data privacy policy. Please refer to this document to understand the data types.
yes
enableBackgroundSync
Configures background data synchronization on SDK initialization (retrieving data when your app is closed or idle).
Default state is true which requires Background Delivery to be enabled for a HealthKit Capability.
Alternatively, use the executeBackgroundSync method in AppDelegate
no
When using the Health Connect module, make sure to define the data types in the ThryveHealthConnectConnectorConfig . This is only relevant for Android integration
dataTypes
Health Connect data types required by your app. Ensure to limit types to data described in your data privacy policy. Please refer to this document to understand the data types.
no, defaults to all supported data types
enableBackgroundSync
Will request background data sync permissions. If permissions are granted, background tasks using WorkManager will be scheduled by the Thryve SDK.
no, defaults to true
enableReadHealthDataHistory
Will request historical data sync permissions. If permissions are granted, timeframes older than 30 days can be requested when using manual data synchronization methods.
no, defaults to true
When using the Samsung Health module, make sure to define the data types in the ThryveSamsungHealthConfig . This is only relevant for Android integration
dataTypes
The Samsung Health data types required by your app. Please refer to this document to understand the data types.
no. defaults to all supported data types
For details on configuring the ThryveBLE and ThryveShenAI modules, refer to their respective documentation pages.
Observability configuration
To continuously improve the performance and stability of the Thryve SDK, the framework reports telemetry data like crashes and traces to Thryve's observability backend. Developers can configure what telemetry data is sent to Thryve using the ObservabilityConfig object.
tracingEnabled
When true, information on performance and errors linked to a Thryve user is reported to Thryve's observability backend. Requires import of ThryveObservability module.
crashReportingEnabled
When true, crashes caused by the ThryveSDK will be reported anonymously to Thryve's observability backend.
true
Observability data is fully handled by Thryve's own infrastructure and never shared or processed with any 3rd party, ensuring the highest degree of data privacy for your end users.
The ThryveObervability module is only available for iOS.
Overview of data shared with Thryve when crash reporting or tracing is enabled
The following data is processed by Thryve when observability functions are enabled:
Crash reporting
When crash reporting is enabled, the following information is sent to Thryve's self-operated observability backend in the event of an app crash:
crash stack trace
app information
authId
bundle id
state (inactive/active)
version
device information
model name
operating system
operating system version
memory size
free memory
session information
app start time
app uptime
app time in foreground
timestamps on actions performed by the SDK, e.g. initialization, execution of methods etc.
Crash reports are anonymous and no IP information or other unique identifiers are collected
Tracing
When tracing is enabled the following information is sent to Thryve's self-operated observability backend:
app information
authId
bundle id
state (inactive/active)
version
device information
model name
operating system
operating system version
memory size
user information
endUserId
process (trace) information
success true/false
ThryveErrors
start/endTimestamp of process
process parameters (e.g. requested HealthKit types, requested timeframes etc.)
process metadata (e.g. number of processed data points)
Last updated

