google_secret_manager 1.0.9 google_secret_manager: ^1.0.9 copied to clipboard
This package provides an API for accessing Google Secret Manager using Dart. This package is useful for developers who want to securely store and retrieve secrets.
example/google_secret_manager_example.dart
import 'dart:io';
import 'package:google_secret_manager/google_secret_manager.dart';
Future<void> main() async {
final path = '${Directory.current.path}/gsm-service-account.json';
final json = File(path).readAsStringSync();
await GoogleSecretManager.initViaServiceAccountJson(json);
final key = 'secret-name';
final response = await GoogleSecretManager.instance.get(key);
print('$key: ${response.payload?.data}');
}