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

@auth31-mobile/auth-service

v1.0.2

Published

React Native authentication service SDK for Auth31 — login, signup, OTP, token management with AsyncStorage

Readme

@auth31-mobile/auth-service

A comprehensive and reusable authentication SDK for React Native applications, featuring Login, Signup, OTP Verification, Forgot Password, and Reset Password flows with dynamic branding and theme support.

🚀 Features

  • Complete Auth Screens & Cards: Pre-built Login, Signup, Verify OTP, Forgot Password, Reset Password, and Set Password screens and embedded card components.
  • Dynamic Remote Branding: Fetch and apply live app logos, colors, background images/gradients via BrandingProvider.
  • Persistent Token Management: Automatic token and refresh token storage and retrieval via @react-native-async-storage/async-storage.
  • Axios HTTP Client Interceptors: Preconfigured API client with automatic token attachment and error normalization.
  • Toast Notifications: Built-in notification system (notify.success, notify.error, etc.) with NotistackProvider.
  • TypeScript First: 100% TypeScript with full type definitions (.d.ts) included out of the box.

📦 Installation

1. Install the SDK

npm install @auth31-mobile/auth-service

2. Install Peer Dependencies

Ensure your React Native project has the required peer dependencies installed:

npm install @react-native-async-storage/async-storage axios react-native-safe-area-context react-native-svg

[!NOTE] If using React Native CLI with iOS, run npx pod-install or cd ios && pod install after installing native dependencies.


🛠️ Quick Start

Wrap your application root with AuthConfigProvider and BrandingProvider:

import React from "react";
import {
  AuthConfigProvider,
  BrandingProvider,
  NotistackProvider,
  LoginScreen,
  SignupScreen,
  VerifyOTPScreen,
  ForgotPasswordScreen,
  ResetPasswordScreen,
} from "@auth31-mobile/auth-service";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";

const Stack = createNativeStackNavigator();

const authConfig = {
  appId: "your-app-id",
  apiBaseUrl: "https://auth31-backend.31g.co.uk/api/v2",
  callbacks: {
    onLoginSuccess: (data) => console.log("Login success:", data),
    onLoginError: (error) => console.error("Login error:", error),
  },
};

export default function App() {
  return (
    <AuthConfigProvider config={authConfig}>
      <BrandingProvider>
        <NotistackProvider>
          <NavigationContainer>
            <Stack.Navigator screenOptions={{ headerShown: false }}>
              <Stack.Screen name="Login" component={LoginScreen} />
              <Stack.Screen name="Signup" component={SignupScreen} />
              <Stack.Screen name="VerifyOTP" component={VerifyOTPScreen} />
              <Stack.Screen name="ForgotPassword" component={ForgotPasswordScreen} />
              <Stack.Screen name="ResetPassword" component={ResetPasswordScreen} />
            </Stack.Navigator>
          </NavigationContainer>
        </NotistackProvider>
      </BrandingProvider>
    </AuthConfigProvider>
  );
}

⚙️ Configuration Reference

AuthConfig

| Property | Type | Requirement | Description | | :--- | :--- | :--- | :--- | | appId | string | Required | Application identifier used for API requests and remote branding. | | apiBaseUrl | string | Required | The base URL for your authentication backend API. | | publicKey | string | Optional | Public key sent via headers with API requests. | | authBaseUrl | string | Optional | Alternative base URL for auth endpoints if different from API base URL. | | endpoints | object | Optional | Custom endpoints to override defaults (login, signup, verifyOtp, etc.). | | callbacks | object | Optional | Event callbacks (onLoginSuccess, onLoginError, onVerifyOtpSuccess, etc.). | | navigation | object | Optional | Navigation hooks to wire screens with your navigation stack. |


📦 Exported Components & Services

Screens & UI Components

  • Screens: LoginScreen, SignupScreen, VerifyOTPScreen, ForgotPasswordScreen, ResetPasswordScreen.
  • Card Components: LoginCard, SignupCard, VerifyOTPCard, ForgotPasswordCard, ResetPasswordCard, SetPasswordCard.
  • UI & Layout: AuthLayout, AuthButton, AuthInput, Logo.

Providers & Hooks

  • Providers: AuthConfigProvider, BrandingProvider, NotistackProvider, ThemeProvider.
  • Hooks: useAuthConfig, useBranding.

Auth & Storage Services

  • Auth Functions: login, signup, verifyOtp, requestOtp, forgotPassword, resetPassword, logout, getCurrentUser, isAuthenticated.
  • Token Storage: getToken, setToken, removeToken, getRefreshToken, setRefreshToken, removeRefreshToken.
  • Utilities: notify, Colors, scale, verticalScale, moderateScale.

📄 License

MIT © 31green