📖
AppKickstarter docs
  • Get Started
    • Get started
    • Initialize third parties
    • Project organization
    • Application initialization
  • Tech things
    • Multi modules Architecture
    • Dependency injection
    • Library management
    • Secrets and Build Config
    • Backend as an implementation detail
  • Tutorials
    • Add a login page
    • Add a screen with tab bars
    • Add a settings screen
    • Display an In-App Changelog for a new published version
    • Update localizations
    • Update theme
    • Customize onboarding
    • Setup your paywall
    • Setup your first notifications
    • Format dates and save on database
    • Using a Different Backend Instead of Firebase
    • Make an infinite list with pagination
  • Features
    • Onboarding
    • Authentication
    • Firebase support
    • Offline support
    • Monetization
    • Whats new feature
    • Navigation in AppKickstarter
    • Theme
    • UI Kit
    • Dates management
    • Platform specific
    • Offline cache
    • Translations
    • Analytics
    • User management
    • Logger
    • Platform utilities
    • Maps and locations
    • Secured AI Backend Proxy
    • Settings
    • Application monitoring
    • Notifications
  • UI Kit
    • Adaptive
    • Advanced Components
    • Animated Components
    • Badges
    • Buttons
    • Cards
    • Containers
    • Dialogs
    • EmptyStates
    • Icons
    • Images
    • Lists
    • Modals
    • Tabs
    • Texts
    • Text fields
    • Toasts
    • Toggles
  • Other
    • Known issues
Powered by GitBook
On this page

Was this helpful?

  1. Tech things

Secrets and Build Config

Understand how store secrets in local.properties and share the secrets in all the platforms (Android, iOS, Web, Desktop)

PreviousLibrary managementNextBackend as an implementation detail

Last updated 1 year ago

Was this helpful?

AppKickstarter leverages to store secrets and dispatch them in all platforms.

For example we have in local.properties this secret:

# Google Sign in
google_sign_in_web_client_id=

In Shared module (build.gradle file) we get the local.properties secrets and create usable constants:

buildkonfig {
    packageName = "com.appkickstarter.shared"

    val props = Properties()

    try {
        props.load(file("../local.properties").inputStream())
    } catch (e: Exception) {
        // keys are private and can not be committed to git
    }

    defaultConfigs {
        buildConfigField(
            STRING,
            "GOOGLE_SIGN_IN_WEB_CLIENT_ID",
            props["google_sign_in_web_client_id"]?.toString() ?: ""
        )
    }
}

This way we can use in Kotlin code (multiplatform) :

private fun initGoogleAuth() {
    val credentials = GoogleAuthCredentials(serverId = BuildKonfig.GOOGLE_SIGN_IN_WEB_CLIENT_ID)
    ...
}
BuildKonfig