credentials_helper 1.0.1 copy "credentials_helper: ^1.0.1" to clipboard
credentials_helper: ^1.0.1 copied to clipboard

outdatedDart 1 only

Provides a helper class to simplify loading credentials from JSON

credentials_helper #

The idea behind this package is to provide a simple way to use various credentials in a project (particularly during development/testing) that is less prone to result in a private API key or the like being commited or published along with your code.

You can store your API keys, usernames, passwords, etc. in a JSON file that is either listed in your .gitignore or completely outside the project directory and load them into this class. You could also retrieve them from other JSON sources.

Example #

credentials.json #

{
  "api_key": "YOUR-API-KEY",
  "username": "yourUsername",
  "password": "yourPassword"
}

Dart code #

import 'package:credentials_helper/credentials_helper.dart';

void main() {

  Credentials credentials = Credentials.fromFile('credentials.json');

  myApiCall(apiKey: credentials.apiKey);

}
1
likes
0
pub points
0%
popularity

Publisher

verified publisherherohtar.com

Provides a helper class to simplify loading credentials from JSON

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

json_annotation

More

Packages that depend on credentials_helper