google-auth is a wrapper library for "Sign in with Google" that simplifies the integration process:
- no need to uglify your html file;
- no untyped global variables;
- framework-agnostic — works with any frontend framework.;
- no hidden properties or any side effects beyond the import;
- includes TypeScript types.
Just type
const google = await GoogleAuth.import();
if (!google) {
// Google lib loading error
return;
}
// Proceed with Google Sign-In
google.accounts.id.initialize(...);
and check the Google documentation for further exploration.