appToolkitModules

fun appToolkitModules(hostBuildConfig: AppToolkitHostBuildConfig, startupProviderFactory: () -> StartupProvider, issueReporterConfig: IssueReporterConfig = IssueReporterConfig(), defaultAdsEnabled: Boolean = true): List<Module>(source)

Every toolkit-owned Koin definition, in one list.

A host that loads this receives the complete toolkit-owned graph. It does not need to know that billing lives in :library:integration:billing or that Firebase lives in :library:integration:firebase, adding a module to the toolkit adds it here, not in every host. Host-owned provider contracts are still supplied in modules loaded after this list; they include settings, about, display, advanced, and privacy providers used by reusable screens.

Why this exists: the modules used to be handed out as four separate entry points plus two loose Module values, and a host had to remember all six. Missing one produced no build error and no warning, just a NoDefinitionFoundException the first time the app touched that dependency at runtime. billingModule was missed exactly this way.

Overriding toolkit defaults

Koin's allowOverride defaults to true, so definitions loaded later win. Load the toolkit first and your own modules after it, and any binding you declare replaces the toolkit's:

startKoin {
androidContext(context)
modules(
buildList {
addAll(appToolkitModules(hostBuildConfig, ::AppStartupProvider))
// Everything below overrides the toolkit defaults above.
add(hostSettingsProvidersModule) // your DisplaySettingsProvider, etc.
add(appModule)
}
)
}

This is how a host supplies SettingsProvider, PrivacySettingsProvider, other host provider contracts, custom settings content, or a different TelemetryRepository without the toolkit needing to know the implementation.

Parameters

defaultAdsEnabled

Fresh-install ads default, used only when the settings file has no choice.

hostBuildConfig

Host build values the toolkit cannot read from its own BuildConfig.

startupProviderFactory

Produces the host's startup screen provider.

issueReporterConfig

Opts the host into shake-to-report, which is off by default. A host that enables it also calls IssueReporterShakeManager.install() from its Application.