Skip to content
pubscout

extension_google_sign_in_as_googleapis_auth

3.0.0, released a year ago by flutter.dev

Creates googleapis_auth AuthClient from GoogleSignIn credentials.

WASM-readyQuiet but busy
$ flutter pub add extension_google_sign_in_as_googleapis_auth
Source repository

What it does

Provides an extension method that converts a GoogleSignIn authorization into a googleapis_auth AuthClient. The client can be used with googleapis package APIs to make authenticated calls.

AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to call Google APIs (e.g., People API) after a user signs in with Google Sign‑In.
  • You want to avoid manually handling OAuth token exchange and refresh logic.

Skip it when

  • You only need basic Google Sign‑In without accessing other Google APIs.
  • You prefer a custom OAuth flow or another authentication provider.

Strengths

  • Bridges two official Flutter packages seamlessly.
  • Handles token refresh automatically via googleapis_auth.
  • Works on all supported platforms (android, ios, web, macos).

Weaknesses

  • Requires the newer GoogleSignInClientAuthorization flow (breaking change in 3.0.0).
  • Limited to Google APIs; not a general OAuth solution.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4
import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart';
import 'package:googleapis_auth/googleapis_auth.dart' as auth show AuthClient;

final authClient = await GoogleSignIn().signIn();
final client = await authClient.authClient(scopes: ['https://www.googleapis.com/auth/contacts.readonly']);
// Use client with googleapis, e.g., PeopleServiceApi(client);

Alternatives

Packages that do the same job and could replace extension_google_sign_in_as_googleapis_auth.

Works with

Packages commonly used together with extension_google_sign_in_as_googleapis_auth: ones it builds on, ones built on it, and its own family.