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

@ackplus/nest-auth-react-native

v2.7.0

Published

React Native / Expo SDK for NestJS authentication - hooks, guards, and secure token storage

Readme

@ackplus/nest-auth-react-native

React Native / Expo SDK for @ackplus/nest-auth.

📚 Full documentation: ack-solutions.github.io/nest-auth

It adds the two things React Native needs on top of the React SDK:

  1. Native token storageAsyncStorageAdapter and SecureStoreAdapter so sessions survive app restarts.
  2. A header-mode client factory — RN can't use http-only cookies, so tokens are sent in the Authorization header and persisted to your storage adapter.

The provider, hooks, and guards from @ackplus/nest-auth-react are re-exported and run unchanged on RN (their web-only code paths are feature-detected). Next.js helpers are intentionally not re-exported.

Install

npm install @ackplus/nest-auth-react-native @ackplus/nest-auth-react @ackplus/nest-auth-client react
# pick a storage backend:
npm install @react-native-async-storage/async-storage   # Bare RN / Expo
# or
npx expo install expo-secure-store                       # Expo, keychain-backed

This package never imports the native storage module directly — you pass it in — so it stays dependency-light and testable.

Quick start

// auth.ts
import AsyncStorage from '@react-native-async-storage/async-storage';
import { createNestAuthClient, AsyncStorageAdapter } from '@ackplus/nest-auth-react-native';

export const authClient = createNestAuthClient({
  baseUrl: 'https://api.example.com',
  storage: new AsyncStorageAdapter(AsyncStorage),
});
// App.tsx
import { AuthProvider } from '@ackplus/nest-auth-react-native';
import { authClient } from './auth';

export default function App() {
  return (
    <AuthProvider client={authClient}>
      <RootNavigator />
    </AuthProvider>
  );
}
// LoginScreen.tsx
import { useNestAuth } from '@ackplus/nest-auth-react-native';

export function LoginScreen() {
  const { login, sessionData, isAuthenticated } = useNestAuth();

  const onSubmit = async (email: string, password: string) => {
    await login({ providerName: 'email', credentials: { email, password } });
  };

  if (isAuthenticated) return <Text>Welcome, {sessionData?.email}</Text>;
  // ...render your form, call onSubmit
}

Secure storage (recommended for production)

import * as SecureStore from 'expo-secure-store';
import { createNestAuthClient, SecureStoreAdapter } from '@ackplus/nest-auth-react-native';

export const authClient = createNestAuthClient({
  baseUrl: 'https://api.example.com',
  storage: new SecureStoreAdapter(SecureStore),
});

Backend setup

Your nest-auth backend should run in header token mode so tokens are returned in the response body:

NestAuthModule.forRoot({
  session: { jwt: { secret: env.JWT_SECRET }, accessTokenType: 'header' },
  // ...
});

API

| Export | Purpose | | --- | --- | | createNestAuthClient(config) | Build a header-mode AuthClient with required storage. | | AsyncStorageAdapter(storage, prefix?) | StorageAdapter over AsyncStorage (or any compatible store). | | SecureStoreAdapter(store, prefix?) | StorageAdapter over Expo SecureStore. | | AuthProvider, useNestAuth, useUser, useSession, useAccessToken, useAuthStatus, useHasRole, useHasPermission, useAuthHeaderFn | Re-exported from the React SDK. | | AuthGuard, GuestGuard, RequireRole, RequirePermission | Conditional-render guards. | | AuthClient, hasRole, hasPermission, … + all @ackplus/nest-auth-contracts types | Re-exported from the core client. |

Social login

Acquire the provider token natively (e.g. @react-native-google-signin/google-signin, Apple authentication) and pass it to authClient.socialLogin(provider, token, opts).

Testing

This package ships a real, no-mock E2E suite: it spawns a real nest-auth backend and drives the client through signup → login → refresh → logout over HTTP.

pnpm -F @ackplus/nest-auth-react-native test

License

MIT