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.
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
theme
Optional instance of ThryveDataSourceConnectionWidgetTheme to style the widget with. Can define a default Light/Dark theme using ThemeMode.LIGHT/ThemeMode.DARK, or define a set of custom colors using ThemeMode.CUSTOM and providing values for backgroundColor, textColor, buttonBackgroundColor, buttonTextColor
no. If omitted, the widget will use the default light theme
Last updated

