Update Thryve SDK and module configs
After the SDK is initialized with getOrCreate, you can change credentials, locale, identity, or module settings without restarting the app.
There are two APIs:
updateSDKConfig
You need to change top-level SDK fields and/or multiple modules together
updateModuleConfig
You only need to update one module (for example device events listener, Shen AI listener, or observability).
updateSDKConfig treats the config as authoritative. Always pass a full ThryveSDKConfig that still includes every module you want to keep active. Omitting a module config (for example Garmin Companion license) can tear that module down at runtime.
ThryveGarminCompanionConfig can not be updated at runtime. It can only be updated after re-intialization using getOrCreate during a restart of your application.
updateModuleConfig does not support updating ThryveObservability configuration in the Thryve Android SDK
Update ThryveSDKConfig at runtime using updateSDKConfig
private func makeFullSDKConfig(endUserId: String?, endUserAlias: String?) -> ThryveSDKConfig {
let credentials = partnerInfo.resolvedCredentialPair()
let backgroundSyncEnabled = UserDefaults.standard.bool(forKey: AppleHealthViewModel.bgSyncKey)
return ThryveSDKConfig(
authId: credentials.authId,
authSecret: credentials.authSecret,
endUserAlias: endUserAlias,
endUserId: endUserId,
locale: partnerInfo.language == "none" ? nil : partnerInfo.language,
configs: [
ThryveAppleHealthConfig(
dataTypes: ThryveAppleHealthDataType.allConnectorTypes,
enableBackgroundSync: backgroundSyncEnabled
),
ThryveShenAIConfig(apiKey: Environment.shenAIApiKey)
],
observability: ObservabilityConfig(
tracingEnabled: observabilityEnabled,
crashReportingEnabled: crashReportingEnabled
)
)
}UpdateModuleConfig at runtime
Which API should I call?
Changing locale, auth, end-user identity, or several modules →
updateSDKConfig(fullConfig)Changing one module listener / one module setting →
updateModuleConfig(...)Changing end-user identity in a way that requires a clean re-init →
getOrCreate(fullConfig)again
Last updated

