googleapis_auth_default_credentials 0.1.0

  • Installing
  • Versions
  • 35


This package provides an implementation of application default credentials for Dart.

The Application Default Credentials provide a simple way to get authorization credentials for use in calling Google APIs.

They are best suited for cases when the call needs to have the same identity and authorization level for the application independent of the user. This is the recommended approach to authorize calls to Cloud APIs, particularly when you're building an application that uses Google Compute Engine.


import 'package:http/http.dart';
import 'package:googleapis_auth_default_credentials/googleapis_auth_default_credentials.dart';
import 'package:googleapis_auth/auth_io.dart';
import 'package:googleapis/storage/v1.dart';

const _SCOPES = const [StorageApi.DevstorageReadOnlyScope];

main() async {
  Client client = new Client();
  AccessCredentials credentials = await obtainDefaultAccessCredentials(_SCOPES, client);
  AuthClient authClient = authenticatedClient(client, credentials);
  final storage = new StorageApi(authClient);
  final buckets = await storage.buckets.list('test');



  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  googleapis_auth_default_credentials: "^0.1.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:googleapis_auth_default_credentials/googleapis_auth_default_credentials.dart';
Version Uploaded Documentation Archive
0.1.0 Oct 6, 2016 Go to the documentation of googleapis_auth_default_credentials 0.1.0 Download googleapis_auth_default_credentials 0.1.0 archive


We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
97 / 100
Reflects how tidy and up-to-date the package is. [more]
32 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:googleapis_auth_default_credentials/googleapis_auth_default_credentials.dart with components: io.


  • Fix .analysis_options.

    We were unable to parse .analysis_options.

  • Package is getting outdated.

    The package was released 87 weeks ago.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Strong-mode analysis of lib/src/default_credentials.dart gave the following hint:

    line: 77 col: 16
    'JSON' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/user_credentials.dart gave the following hint:

    line: 23 col: 14
    'JSON' is deprecated and shouldn't be used.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

      strong-mode: true


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
googleapis ^0.31.0 0.31.0 0.51.0
googleapis_auth ^0.2.3 0.2.5
http >=0.11.1 <0.12.0 0.11.3+16
path ^1.3.9 1.6.0
Transitive dependencies
_discoveryapis_commons 0.1.6
async 2.0.7
charcode 1.1.1
collection 1.14.10
convert 2.0.1
crypto 2.0.3
http_parser 3.1.2
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
test >=0.12.0 <0.13.0