npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-nitro-google-sso

v1.2.0

Published

Nitro module package

Downloads

214

Readme

React Native Nitro Google SSO

React Native Nitro Google SSO Banner

A Simple React Native module for implementing Google Sign-In (SSO) functionality in your React Native applications uses Google Sign-In SDK on iOS and Credential Manager on Android.

Requirements

  • React Native v0.78.0 or higher
  • Node 18.0.0 or higher

[!IMPORTANT]
To use Google Sign-In Button you need to install React Native version v0.78.0 or higher.

Installation

bun add react-native-nitro-google-sso react-native-nitro-modules
# or
npm install react-native-nitro-google-sso
# or
yarn add react-native-nitro-google-sso

Prerequisites

Before using this module, you need to:

  1. Set up a Google Cloud Project
  2. Configure OAuth 2.0 credentials
  3. Get your iOS Client ID and Web Client ID from the Google Cloud Console

Configuration

First, you need to configure the module with your Google credentials. It's recommended to do this in your app's entry point:

import NitroGoogleSSO from 'react-native-nitro-google-sso'

// Configure the module
NitroGoogleSSO.configure({
  iosClientId: 'YOUR_IOS_CLIENT_ID',
  webClientId: 'YOUR_WEB_CLIENT_ID',
  nonce: 'YOUR_NONCE', // Optional security nonce
})

Usage

Sign In

To sign in with Google:

try {
  const user = await NitroGoogleSSO.signIn()
  if (user) {
    console.log('User signed in:', user)
  } else {
    console.log('User cancelled sign in')
  }
} catch (error) {
  console.error('Sign in error:', error)
}

One Tap Sign In

To sign in with Google using the one tap sign in:

try {
  const user = await NitroGoogleSSO.oneTapSignIn()
  if (user) {
    console.log('User signed in:', user)
  } else {
    console.log('User cancelled sign in')
  }
} catch (error) {
  console.error('Sign in error:', error)
}

Get Current User

To get the currently signed-in user's information:

try {
  const user = await NitroGoogleSSO.getCurrentUser()
  if (user) {
    console.log('Current user:', user)
  } else {
    console.log('No user is signed in')
  }
} catch (error) {
  console.error('Error getting current user:', error)
}

Sign Out

To sign out the current user:

try {
  await NitroGoogleSSO.signOut()
  console.log('User signed out successfully')
} catch (error) {
  console.error('Sign out error:', error)
}

Types

NitroGoogleSSOConfig

interface NitroGoogleSSOConfig {
  iosClientId: string
  webClientId: string
  nonce?: string
  hostedDomain?: string
}

NitroGoogleUserInfo

The user information returned by the sign-in process. The exact structure depends on the information requested during the sign-in process.

Platform Support

This module supports both iOS and Android platforms.

Error Handling

Always wrap the module's methods in try-catch blocks as they may throw errors in various scenarios:

  • Network connectivity issues
  • Invalid configuration
  • User cancellation
  • Authentication failures

Best Practices

  1. Configure the module as early as possible in your app's lifecycle
  2. Handle all potential errors appropriately
  3. Implement proper state management for the user's authentication status
  4. Store sensitive credentials securely
  5. Implement proper error recovery mechanisms

Credits

Bootstrapped with create-nitro-module.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT