This project uses BuildKonfig to securely manage build configuration variables like Supabase credentials.
- Open
local.propertiesin the project root - Uncomment and add your Supabase credentials:
supabase.url=https://your-project-id.supabase.co
supabase.key=your-anon-public-key
bugsnag.apiKey=your-bugsnag-api-keySet the following environment variables:
export SUPABASE_URL=https://your-project-id.supabase.co
export SUPABASE_KEY=your-anon-public-key
export BUGSNAG_API_KEY=your-bugsnag-api-keyThe configuration uses the following priority (first found wins):
local.propertiesfile- Environment variables
- Default placeholder values (will not work with real Supabase)
- Go to your Supabase Dashboard
- Select your project
- Go to Settings → API
- Copy:
- Project URL → Use as
supabase.urlorSUPABASE_URL - Project API key (anon public) → Use as
supabase.keyorSUPABASE_KEY
- Project URL → Use as
The BuildConfig class is generated in the client:shared module and can be accessed from any module that depends on it:
import com.plusmobileapps.chefmate.buildconfig.BuildConfig
val supabaseUrl = BuildConfig.SUPABASE_URL
val supabaseKey = BuildConfig.SUPABASE_KEY
val bugsnagApiKey = BuildConfig.BUGSNAG_API_KEYTo add new build configuration values, edit client/shared/build.gradle.kts:
buildkonfig {
packageName = "com.plusmobileapps.chefmate.buildconfig"
objectName = "BuildConfig"
defaultConfigs {
buildConfigField(STRING, "SUPABASE_URL", supabaseUrl)
buildConfigField(STRING, "SUPABASE_KEY", supabaseKey)
// Add your new field here
buildConfigField(STRING, "NEW_FIELD", newValue)
}
}- Never commit
local.propertieswith real credentials - it's already in.gitignore - The anon/public key is safe to use in client-side code (it's meant to be public)
- For sensitive operations, always use Row Level Security (RLS) in your Supabase database
- developer-settings.md — how to wire up the staging Supabase URL (
supabase.testing.*/SUPABASE_TESTING_*) and pre-baked test users for the in-app developer menu.