Storing API Key using BuildKonfig on Kotlin Multiplatform

Andrea
2 min readOct 10, 2023

This case is appear as part of my journey building Weather App on KMM. As my basic is come from Android, one of the most common way storing the API Key is to store it on local.properties, and you can retrieve it from any file inside Android by using BuildConfig.API_KEY

// inside local.properties :
API_KEY = 629adc362b515d46302d4XXXXXXXXXX

However, this method will not working on KMM. It is possible to do the same if using BuildKonfig library. This library made us easier to create a specified BuildKonfig…

--

--