Hi, does anyone maybe have some example of how to...
# ktor
v
Hi, does anyone maybe have some example of how to setup HttpClient in multiplatform app with KOIN. Maybe I completely missed architecture decision but I have createHttpClient function in common main that needs AuthManager class which is KOIN dependency. In commonMain/App.kt I would then have param client and in each platform (jvm, iOS, android) pass the proper engine in createHttpClient( authManager = get(), CIO.create) But this does not seem to work, my client instance does not have setup from createHttpClient function (serialization plugins or anything)... I there is some example of this setup I would appreciate it.
j
this youtube video might help

https://youtu.be/dxdtyICzwPs?t=2102

j
I don’t have an example, but if your AuthManager is from Koin I’d put your createHttpClient call in a Koin module too.
Each platform can bind another Koin dependency which is the engine, and you can access it when calling createHttpClient