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

@truworth/twc-auth

v1.2.11

Published

Truworth Auth Package for React Native and Web

Readme

@truworth/twc-auth

Truworth Auth Module - A comprehensive authentication solution for React Native and Web applications.

Table of Contents

Installation

React Native

  1. Install the package:

    npm install @truworth/twc-auth
  2. Install peer dependencies:

    npm install \
      @react-native-community/datetimepicker \
      @react-navigation/native \
      @react-navigation/native-stack \
      @truworth/twc-rn-common \
      @eva-design/eva \
      @ui-kitten/components \
      react-native-gesture-handler \
      react-native-linear-gradient \
      react-native-modalize \
      react-native-reanimated \
      react-native-screens \
      react-native-safe-area-context \
      react-native-svg \
      react-native-vector-icons \
      react@^18.2.0 \
      react-native@^0.74.5
  3. For iOS, install pods:

    npx pod-install
  4. For React Native Reanimated, follow the installation steps if you haven't already.

  5. For React Navigation, wrap your app with NavigationContainer and ensure you've followed the getting started guide.

React Native Dependencies

| Package | Version | | -------------------------------------- | -------- | | @react-native-community/datetimepicker | >=8.1.1 | | @react-navigation/native | >=6.1.17 | | @react-navigation/native-stack | >=6.10.0 | | @truworth/twc-rn-common | >=1.0.12 | | @ui-kitten/components | >=5.1.2 | | @eva-design/eva | >=2.2.0 | | lottie-react-native | >=6.7.2 | | react | >=18.2.0 | | react-native | >=0.74.5 | | react-native-fast-image | >=8.6.3 | | react-native-gesture-handler | >=2.16.0 | | react-native-linear-gradient | >=2.8.3 | | react-native-modalize | >=2.1.1 | | react-native-reanimated | >=3.13.0 | | react-native-safe-area-context | >=5.3.0 | | react-native-screens | >=3.31.1 | | react-native-svg | >=15.8.0 | | react-native-vector-icons | >=9.2.0 |

Note: lottie-react-native, react-native-fast-image are optional and only needed if your app uses features that depend on them.

Web Dependencies

| Package | Version | | ------------------------ | -------- | | @truworth/twc-web-design | ^1.9.0 | | antd | ^5.6.3 | | framer-motion | ^12.6.2 | | lodash | ^4.17.21 | | lucide-react | ^0.483.0 | | next | ^15.0.4 | | react | ^18.2.0 | | react-dom | ^18.2.0 |

Web

  1. Install the package:

    npm install @truworth/twc-auth
  2. Install peer dependencies:

    npm install \
      next@^15.0.4 \
      @truworth/twc-web-design@^1.9.0 \
      antd@^5.6.3 \
      framer-motion@^12.6.2 \
      lodash@^4.17.21 \
      lucide-react@^0.483.0 \
      react@^18.2.0 \
      react-dom@^18.2.0

Development: Configure Hot Reloading

React Native Setup for Hot Reloading

Prerequisites

Update main field in package.json to ./src/index.tsx

//package.json
{
  ...
- "main": "./build/src/index.js"
+ "main": "./src/index.tsx"
  ...
}

Note: This change is for local development (hot reloading) only. Before publishing, restore "main" to the built JS (e.g., ./build/src/index.js) or use the "exports" field to map dev vs prod entry points.

Add package to your main project's package.json file's dependencies field

//package.json
{
  ...
  "dependencies": {
    ...
+    "@truworth/twc-auth": "file:relative/path/to/package"
    ...
  }
  ...
}

React Native

Copy get-metro-config.js in your main project

Import getMetroConfig from get-metro-config.js and use it to merge with your project's metro config

// mainProject/metro.config.js
+ const { getMetroConfig } = require('./get-metro-config')
+ const packageConfig = getMetroConfig(__dirname, 'relative/path/to/package')
...
- module.exports = mergeConfig(defaultConfig, config);
+ module.exports = mergeConfig(defaultConfig, config, packageConfig);

Next.js Setup for Hot Reloading

Copy get-next-config.js in your main project

Import getNextConfig from get-next-config.js and use it to merge with your project's next config

// mainProject/next.config.js
+ const { getNextConfig } = require('./get-next-config')
+ const packageConfig = getNextConfig(__dirname, 'relative/path/to/package')
...
const nextConfig = {
...
+ transpilePackages: [packageConfig.packageName],
  webpack: (config) => {
    ...
+   config.resolve.alias = {
+   ...config.resolve.alias,
+   ...packageConfig.webpackAlias
+   }
    ...
    return config;
  },
}
...
module.exports = nextConfig;

Usage

React Native

import React, { useEffect } from "react";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { NavigationContainer } from "@react-navigation/native";
import { AuthNavigator, AuthProvider } from "@truworth/twc-auth";
import type { LoginResponse } from "@truworth/twc-auth";
import Home from "./screens/Home";

const { Navigator, Screen } = createNativeStackNavigator();

const ExampleAppNavigator = () => {
  const onLogin = async (result: LoginResponse) => {
    //TODO: Store token in secure storage & redirect to home screen
  };

  return (
    <NavigationContainer>
      <AuthProvider onLogin={onLogin}>
        <Navigator screenOptions={{ headerShown: false }}>
          <Screen name="AuthNavigator" component={AuthNavigator} />
        </Navigator>
      </AuthProvider>
    </NavigationContainer>
  );
};

export default ExampleAppNavigator;

Web (Next.js)

// pages/_app.tsx
import { AuthProvider } from "@truworth/twc-auth";
import type { LoginResponse } from "@truworth/twc-auth";
import type { AppProps } from "next/app";

export default function App({ Component, pageProps }: AppProps) {
  const onLogin = (result: LoginResponse) => {
    //TODO: Store token in secure storage & redirect to home screen
  };

  return (
    <AuthProvider onLogin={onLogin}>
      <Component {...pageProps} />
    </AuthProvider>
  );
}

API Reference

Hooks

useAuthContext()

const { onLogin, logout, onLaunchAuthSession, LogoComponent } = useAuthContext();

Troubleshooting

Common Issues

  1. Module not found

    • Ensure all peer dependencies are installed
    • Clear Metro bundler cache: npx react-native start --reset-cache
    • For Next.js, remove .next and restart: rm -rf .next && next dev
    • For React Native: Ensure babel.config.js includes plugins: ['react-native-reanimated/plugin'] as the last plugin
    • For Next.js with Babel: Add plugins: ['react-native-reanimated/plugin'] to your Babel config if using Babel (not needed with default SWC)
    • For iOS CocoaPods issues: First try cd ios && pod install or clean the build folder in Xcode. Only use pod deintegrate as a last resort if other steps fail.