publicVariables property

Map<String, String> get publicVariables

Returns an unmodifiable snapshot map of only the client-public environment variables.

Filters the loaded environment map to include only keys starting with publicPrefix. Non-public variables are omitted to ensure server secrets are never bundled into browser client artifacts.

final publicConfig = BloomEnv.publicVariables;
print('Public vars: ${publicConfig.keys}');

Implementation

static Map<String, String> get publicVariables {
  final filtered = <String, String>{};
  for (final entry in _env.entries) {
    if (isPublic(entry.key)) {
      filtered[entry.key] = entry.value;
    }
  }
  return UnmodifiableMapView(filtered);
}