Skip to content

Add DI integration guide (Hilt / Koin) #17

Description

@piotrekno1

Problem

There is no example of how to wire WildEdgeClient into a Hilt or Koin project. DI misconfiguration is one of the most common integration mistakes, so the absence of guidance leads to duplicate singleton instances, leaked clients, or build failures.

Proposed solution

Add a DI integration section to the README (and/or docs site) with copy-paste modules for Hilt and Koin. No new SDK artifacts required.

Hilt

@Module
@InstallIn(SingletonComponent::class)
object WildEdgeModule {

    @Provides
    @Singleton
    fun provideWildEdgeClient(@ApplicationContext context: Context): WildEdgeClient =
        WildEdgeClient.Builder(context)
            .dsn("YOUR_DSN")
            .build()
}

Koin

val wildEdgeModule = module {
    single {
        WildEdgeClient.Builder(androidContext())
            .dsn("YOUR_DSN")
            .build()
    }
}

Alternatives considered

Shipping separate wildedge-hilt / wildedge-koin artifacts that auto-wire the client. Decided against it for now because it adds two new artifacts to maintain and brings annotation processing dependencies into the SDK distribution. A doc section covers 95% of the need at zero maintenance cost.


Vote with a reaction if you want this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions