LocalSecureVault

val LocalSecureVault: ProvidableCompositionLocal<<Error class: unknown class>>

CompositionLocal that exposes the currently-installed SecureVault to any composable in the tree below a ProvideSecureVault call.

Reading this outside a ProvideSecureVault scope is a programmer error and throws with a clear message. There is intentionally no default value — silently constructing a vault on demand would hide initialisation cost from the caller.

@Composable
fun LoginScreen() {
val vault = LocalSecureVault.current
val scope = rememberCoroutineScope()
Button(onClick = { scope.launch { vault.put("token", "...") } }) {
Text("Sign in")
}
}

Since

0.1.0