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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@crown-dev-studios/google-auth

v0.4.0

Published

React Native Google sign-in that returns a one-time server `authCode` instead of doing token exchange on-device. Use this when your backend owns Google OAuth and your mobile app only needs to start the flow and hand the code to your server.

Readme

@crown-dev-studios/google-auth

React Native Google sign-in that returns a one-time server authCode instead of doing token exchange on-device. Use this when your backend owns Google OAuth and your mobile app only needs to start the flow and hand the code to your server.

What It Includes

  • Native Google auth-code sign-in for iOS and Android
  • Scope management helpers for incremental consent flows
  • Expo config plugin for wiring the native setup in prebuilt apps
  • A small JS API surface with no opinion about your backend

Install

npm install @crown-dev-studios/google-auth

Peer dependency:

npm install react-native

If you are using Expo, use a custom dev client or a prebuilt app. Expo Go is not supported because this package ships native code.

Quick Start

import {
  configureGoogleAuth,
  signInWithGoogle,
} from '@crown-dev-studios/google-auth'

await configureGoogleAuth({
  iosClientId: 'your-ios-client-id.apps.googleusercontent.com',
  webClientId: 'your-web-client-id.apps.googleusercontent.com',
  scopes: ['openid', 'email', 'profile'],
})

const { authCode, grantedScopes } = await signInWithGoogle()
// Send authCode to your server for exchange.

API

configureGoogleAuth(config)

Configures the native Google SDKs.

await configureGoogleAuth({
  iosClientId: 'ios-client-id',
  webClientId: 'web-client-id',
  scopes: ['openid', 'email', 'profile'],
})

Notes:

  • webClientId is always required.
  • iosClientId is required on iOS.
  • If scopes is omitted, the default is ['openid', 'email', 'profile'].

signInWithGoogle()

Starts Google sign-in and resolves to:

type GoogleAuthResult = {
  authCode: string
  grantedScopes: string[]
}

updateGoogleScopes(request)

Requests additional scopes or replaces the previously granted set.

import { updateGoogleScopes } from '@crown-dev-studios/google-auth'

await updateGoogleScopes({
  scopes: ['https://www.googleapis.com/auth/calendar.readonly'],
  mode: 'add',
})

mode:

  • 'add' adds new scopes to the current session
  • 'replace' replaces the current set

getGoogleGrantedScopes()

Returns the scopes currently known to be granted for the active session.

revokeGoogleAccess()

Disconnects the app from the Google account and revokes the granted access.

signOutGoogle()

Signs out locally without necessarily revoking previously granted access.

Expo Config Plugin

Add the plugin in app.config.ts or app.json:

export default {
  plugins: [
    [
      '@crown-dev-studios/google-auth/plugin',
      {
        iosClientId: 'your-ios-client-id.apps.googleusercontent.com',
        webClientId: 'your-web-client-id.apps.googleusercontent.com',
      },
    ],
  ],
}

The plugin requires both iosClientId and webClientId. If either is missing, native Google Sign-In configuration is skipped.

Typical Use Case

  1. Configure the package at app startup.
  2. Call signInWithGoogle().
  3. Post the returned authCode to your backend.
  4. Exchange the code server-side and continue your auth flow.

This package intentionally does not store access tokens or refresh tokens for you.