Using the new JS client library for Sign in with Google, I can't find a way to start a sign-in flow without rendering the button, and the button can't be customized enough to align with the aesthetics of the site.
Is there any way to trigger the auth flow without the button? For example:
// instead of:
window.google.accounts.id.renderButton(divRef.current, {
theme: 'outline',
size: 'large',
width: divRef.current.clientWidth,
text: 'continue_with',
});
// I want something like:
window.google.accounts.id.authenticate();
Typically, user's must press a button to begin sign-in. However, you might want to check out Automatic sign-in by setting auto_select: true in google.accounts.id.initialize(). For returning users, this feature will automatically sign them in after a small delay to allow the user to cancel sign-in. This can help avoid the need for a button press and might be useful to avoid nagging users to sign-in when visiting multiple deep links within your site.