JavaScript Bridge
Google Sign-In Bridge
Trigger native Google account selection and receive profile, server code, or ID token data.
Before you start
- Valid Android OAuth client
- Optional Web Client ID for code or ID token response
- Backend token validation
Configure and verify
Choose the response type
Use profile for account information, code for backend exchange, or id_token when your server validates Google ID tokens.
Start sign-in
Call webtoapp.googleSignIn with Web Client ID, scopes, response type, optional redirect URI, and state.
Handle the response
Listen for webtoapp:google-sign-in or webtoapp.onmessage. Handle cancel and error states.
Validate server-side
Verify code or token and state before creating the website session.
Example
webtoapp.googleSignIn({
web_client_id: "WEB_CLIENT_ID",
scope: "openid email profile",
response_type: "code",
state: crypto.randomUUID()
});Test before release
- State is unpredictable and verified
- Token is validated on the server
- Cancellation is handled
- Play signing fingerprint is configured