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

react-native-firebase-auth-hoc

v0.3.4

Published

RN Auth-HOC

Downloads

11

Readme

Auth HOC

Usage

import React from 'react';
import { TouchableOpacity, View, Text } from 'react-native';
import withAuth, { Provider as AuthProvider } from 'react-native-firebase-auth-hoc';

function Home({ auth }) {
  return (
    <View
      style={{
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
      }}
    >
      <Text>{JSON.stringify(auth.user)}</Text>
    </View>
  );
}

const HomeWithHOC = withAuth(Home, {
  style: {
    backgroundColor: '#fdfdfd'
  },
  buttonStyle: {
    backgroundColor: 'lightblue'
  }
});

class App extends React.Component {
  render() {
    return (
      <AuthProvider
        onInit={uid =>
          new Promise(r => {
            setTimeout(() => {
              r({ age: 30, gender: 'male' });
            }, 500);
          })
        }
      >
        <HomeWithHOC />
      </AuthProvider>
    );
  }
}

export default App;

Provider

Reference

Props

| property | description | | ----------------- | ----------------------------------------------------------------------------- | | onInit | Functions executed at initialization and updating of custom user information. |

onInit

| NAME | TYPE | REQUIRED | DESCRIPTION | | ------- | ------- | -------- | ------------------------------------------ | | promise | Promise | Yes | Promise to return user information to add. |

withAuth

Reference

Options

withAuth((Component: React.ComponentClass<any>), (options: Options = initialOptions));
emailConfig?: {
  title?: string;
  style?: {};
  textStyle?: {};
  renderButton?: Button;
} | null;
anonymousConfig?: {
  title?: string;
  style?: {};
  textStyle?: {};
  renderButton?: Button;
} | null;
facebookConfig?: {
  title?: string;
  style?: {};
  textStyle?: {};
  getToken: () => Promise<any>;
  renderButton?: Button;
};
googleConfig?: {
  title?: string;
  style?: {};
  textStyle?: {};
  getToken: () => Promise<any>;
  renderButton?: Button;
};
logoConfig?: {
  title?: string;
  style?: {};
  renderLogo?: () => Element;
};
initializerConfig?: {
  text?: string;
  style?: {};
  duration?: number;
  renderInitializer?: () => Element;
};
renderLoginBackScreen?: () => Element;
style?: {};

Property

| property | description | | -------- | ------------- | | user | firebase.user |

Methods

| methods | description | | ----------------------------------------------------------------- | ----------------------------------------------------------------------- | | signIn | Change to login status. | | signOut | Change to logout status. | | signInAnonymously | Asynchronously signs in as an anonymous user. | | signInWithFacebook | You can log in to Facebook via a promise function that returns a token. | | signInWithGoogle | You can log in to Google via a promise function that returns a token. | | createUserWithEmailAndPassword | Asynchronously signs in using an email and password. |

signIn()

signIn();

signOut()

signOut();

signInAnonymously()

signInAnonymously();

signInWithFacebook()

signInWithFacebook: (promise: () => Promise<string>) => Promise<any>;

| NAME | TYPE | REQUIRED | DESCRIPTION | | ------- | ------- | -------- | ---------------------------------- | | promise | Promise | Yes | Promise to return a Facebook token |

async function getExpoFacebookToken() {
  const response = await Expo.Facebook.logInWithReadPermissionsAsync(FACEBOOK_APP_ID, {
    permissions: ['public_profile', 'email'],
    behavior: 'web'
  });

  if (response.type === 'success') {
    return response.token;
  } else {
    throw new Error('Expo Error');
  }
}

signInWithFacebook(getExpoFacebookToken);

signInWithGoogle()

signInWithGoogle: (promise: () => Promise<string>) => Promise<any>;

| NAME | TYPE | REQUIRED | DESCRIPTION | | ------- | ------- | -------- | -------------------------------- | | promise | Promise | Yes | Promise to return a Google token |

async function getExpoGoogleToken() {
  const response = await Expo.Google.logInAsync({
    androidClientId: YOUR_CLIENT_ID_HERE,
    iosClientId: YOUR_CLIENT_ID_HERE,
    scopes: ['profile', 'email']
  });

  if (response.type === 'success') {
    return response.accessToken;
  } else {
    throw new Error('Expo Error');
  }
}

signInWithGoogle(getExpoGoogleToken);

createUserWithEmailAndPassword()

createUserWithEmailAndPassword: (email: string, password: string) => Promise<any>;

| NAME | TYPE | REQUIRED | DESCRIPTION | | -------- | ------ | -------- | ----------- | | email | string | Yes | email | | password | string | Yes | password |

Support

react-navigation

withAuth(createBottomTabNavigator({
  Home: HomeScreen,
  Settings: SettingsScreen,
});

// Home, Settings -> screenProps.auth