Socket
Socket
Sign inDemoInstall

@react-native-google-signin/google-signin

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-google-signin/google-signin

Google Signin for your react native applications


Version published
Maintainers
1
Created

What is @react-native-google-signin/google-signin?

@react-native-google-signin/google-signin is a React Native library that allows you to integrate Google Sign-In into your mobile applications. It provides a simple and secure way to authenticate users using their Google accounts.

What are @react-native-google-signin/google-signin's main functionalities?

Sign In

This feature allows users to sign in to your app using their Google account. The code sample demonstrates how to check for Google Play services and initiate the sign-in process.

import { GoogleSignin } from '@react-native-google-signin/google-signin';

async function signIn() {
  try {
    await GoogleSignin.hasPlayServices();
    const userInfo = await GoogleSignin.signIn();
    console.log(userInfo);
  } catch (error) {
    console.error(error);
  }
}

Sign Out

This feature allows users to sign out of their Google account within your app. The code sample demonstrates how to sign out a user.

import { GoogleSignin } from '@react-native-google-signin/google-signin';

async function signOut() {
  try {
    await GoogleSignin.signOut();
    console.log('User signed out');
  } catch (error) {
    console.error(error);
  }
}

Revoke Access

This feature allows users to revoke access to their Google account. The code sample demonstrates how to revoke access.

import { GoogleSignin } from '@react-native-google-signin/google-signin';

async function revokeAccess() {
  try {
    await GoogleSignin.revokeAccess();
    console.log('Access revoked');
  } catch (error) {
    console.error(error);
  }
}

Get Current User

This feature allows you to get the currently signed-in user's information without prompting them to sign in again. The code sample demonstrates how to retrieve the current user's information silently.

import { GoogleSignin } from '@react-native-google-signin/google-signin';

async function getCurrentUser() {
  try {
    const userInfo = await GoogleSignin.signInSilently();
    console.log(userInfo);
  } catch (error) {
    console.error(error);
  }
}

Other packages similar to @react-native-google-signin/google-signin

Keywords

FAQs

Package last updated on 22 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc