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.

Thryve Connection Widget makes it super simple to allow users to connect theiir data sources

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.

circle-exclamation
Parameter
Description
Mandatory

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

circle-exclamation

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.

Parameter
Description
Mandatory

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

circle-exclamation
triangle-exclamation

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.

Parameter
Description
Mandatory

locale

Manually set the language code following ISO 639-1arrow-up-right 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.

circle-info

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.

Parameter
Description
Mandatory

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.

Parameter
Description
Mandatory

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.

Parameter
Description
Mandatory

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

circle-info

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.

Parameter
Description
Default

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.

circle-info

The ThryveObervability module is only available for iOS.

chevron-rightOverview of data shared with Thryve when crash reporting or tracing is enabledhashtag

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.

triangle-exclamation

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