google_secret_manager 1.1.0 google_secret_manager: ^1.1.0 copied to clipboard
A library for accessing the Secret Manager API.
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}/gcm-service-account.json';
final file = File(path);
final json = await file.readAsString();
await GoogleSecretManagerInitializer.initViaServiceAccountJson(json);
final key = 'adjust_token';
final response = await GoogleSecretManager.instance.get(key);
print('$key: ${response?.payload?.data}');
}