react-native-google-one-tap-signin
v1.1.1
Published
Google One Tap Sign In for your react native applications
Downloads
1,518
Readme
react-native-mediastore
React Native Google One Tip Signin (only Android)
Installation
npm install react-native-google-one-tap-signinyarn add react-native-google-one-tap-signinUsage
import GoogleOneTapSignIn from "react-native-google-one-tap-signin";
const handleSignIn = async () => {
try {
await GoogleOneTapSignIn.configure({
webClientId: GOOGLE_ONE_TAP_SIGN_IN,
})
const userInfo = await GoogleOneTapSignIn.signIn()
if (!userInfo || !userInfo.idToken) {
console.error('GoogleOneTapSignIn error', 'There was some issue with getting id token', userInfo)
return
}
// YOUR USER HERE
// You can store this value in store or sign in to your backend
console.log(userInfo)
} catch (error) {
// We might want to provide this error information to an error reporting service
console.error('GoogleOneTapSignIn error', error)
}
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
