Package-level declarations
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
EnvSource, DotEnvSource, PropertiesSource and the Android initializer.
Types
Reads a .env file of KEY=value lines, with keys in SCREAMING_SNAKE_CASE. Unlike the other file sources, keys are matched exactly, including case.
Reads environment variables, with keys in SCREAMING_SNAKE_CASE (DATABASE_URL). Names are matched exactly, including case. Variables are read at each lookup, not copied up front. On JS and Wasm it reads process.env under Node; browsers have no environment, so every lookup there returns null.
Captures the application context at startup so bundled assets can be read without a Context. Not registered by default, so apps that don't read assets get no extra provider. To use it, declare it in your app's manifest:
Reads .properties files. Keys use dot.notation, with SCREAMING_SNAKE_CASE as a fallback; a key with no exact match falls back to a case-insensitive one.
Functions
Gives Konstant the application context for reading assets. Needed only for fromResource sources: call it in Application.onCreate before loading, or register KonstantInitProvider in your manifest to do it at app start.
Reads the text file at path. Throws if it cannot be read; in browsers, which have no file system, it always throws. Used by the sources' fromFile functions.
Reads the text file at path. Throws if it cannot be read; in browsers, which have no file system, it always throws. Used by the sources' fromFile functions.
Reads the text file at path. Throws if it cannot be read; in browsers, which have no file system, it always throws. Used by the sources' fromFile functions.
Reads the text file at path. Throws if it cannot be read; in browsers, which have no file system, it always throws. Used by the sources' fromFile functions.
Reads the text file at path. Throws if it cannot be read; in browsers, which have no file system, it always throws. Used by the sources' fromFile functions.
Reads the text file at path. Throws if it cannot be read; in browsers, which have no file system, it always throws. Used by the sources' fromFile functions.
Reads a text file shipped inside the app, or null if there is none at path:
Reads a text file shipped inside the app, or null if there is none at path:
Reads a text file shipped inside the app, or null if there is none at path:
Reads a text file shipped inside the app, or null if there is none at path:
Reads a text file shipped inside the app, or null if there is none at path:
Reads a text file shipped inside the app, or null if there is none at path:
Reads a text file shipped inside the app, or null if there is none at path: