google_secret_manager 1.1.0 copy "google_secret_manager: ^1.1.0" to clipboard
google_secret_manager: ^1.1.0 copied to clipboard

A library for accessing the Secret Manager API.

A library for accessing the Secret Manager API.

Getting started #

First create a service account and download the JSON key file.

Then, add this package to your pubspec.yaml file:

dependencies:
  google_secret_manager:

Usage #

To use the [GoogleSecretManager] class, you first need to initialize it via the [GoogleSecretManagerInitializer] class. You can do this by calling the [GoogleSecretManagerInitializer.initViaServiceAccountJson] method and passing the downloaded JSON key file as a string:

final path = '${Directory.current.path}/service-account.json';
final file = File(path);
final json = await file.readAsString();
await GoogleSecretManagerInitializer.initViaServiceAccountJson(json);

Then, you can access the secret value by calling the GoogleSecretManager.get method:

final response = await GoogleSecretManager.instance.get('secret-name');

For more information you can see a full example in the example folder.

Additional information #

If you're interested in contributing to the development of this package, I welcome your contributions! One way to do so is by submitting a pull request (PR) on our GitHub repository.

To get started, you'll need to fork the repository to your own GitHub account. Then, make your changes or additions in a new branch on your forked repository. Once you've made your changes, you can submit a pull request to my main repository.

We encourage you to include a detailed description of your changes, along with any relevant documentation and tests. I will review your pull request and provide feedback as needed.

11
likes
140
points
107
downloads

Publisher

verified publishermiddelkamp.dev

Weekly Downloads

A library for accessing the Secret Manager API.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

googleapis, googleapis_auth, http

More

Packages that depend on google_secret_manager