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

@seamless-auth/react-native

v0.1.0

Published

Headless React Native binding for Seamless Auth: provider, hooks, and the native ports for passkeys, secure token storage, and in-app browser OAuth.

Readme

@seamless-auth/react-native

The React Native binding for Seamless Auth. Headless: an AuthProvider, the hooks a screen needs, and the native ports for passkeys, secure token storage, and in-app browser OAuth. You bring the screens; the flows, session state, and token custody come from @seamless-auth/client.

The app talks to your backend's Seamless Auth server adapter (the same /auth mount your web app uses) over bearer transport: the client holds the auth API's tokens, presents the right one on each request, keeps the pair in the platform keystore between launches, and refreshes through POST /auth/refresh when the access token expires. Your backend needs @seamless-auth/express or @seamless-auth/fastify 0.16 or later, and its own routes accept the same access token once requireAuth is given authServerUrl and audience.

Install

npx expo install @seamless-auth/react-native expo-secure-store react-native-passkeys expo-web-browser

expo-secure-store, react-native-passkeys and expo-web-browser are not dependencies of this package. Each port takes the module as a parameter, so an app that does not use OAuth, for example, never installs expo-web-browser and Metro never looks for it.

Wire it up

import * as Passkeys from 'react-native-passkeys';
import * as SecureStore from 'expo-secure-store';
import * as WebBrowser from 'expo-web-browser';
import {
  AuthProvider,
  createNativePasskeyPort,
  createSecureStoreTokenStorage,
  createWebBrowserOAuthRedirect,
} from '@seamless-auth/react-native';

const ports = {
  passkeys: createNativePasskeyPort(Passkeys),
  tokenStorage: createSecureStoreTokenStorage(SecureStore),
  oauthRedirect: createWebBrowserOAuthRedirect(WebBrowser),
};

export default function App() {
  return (
    <AuthProvider apiHost={process.env.EXPO_PUBLIC_API_URL!} ports={ports}>
      <Screens />
    </AuthProvider>
  );
}

Build ports once, at module scope or in a useMemo: the provider keys its session on the port identities.

On an Android emulator the host machine is http://10.0.2.2:<port>, not localhost.

Use it

import {
  useAuth,
  useAuthClient,
  useLoginMethods,
  usePasskeySupport,
} from '@seamless-auth/react-native';

function SignIn() {
  const { login, handlePasskeyLogin, isAuthenticated, loading } = useAuth();
  const client = useAuthClient();
  const { loginMethods } = useLoginMethods();
  const { passkeySupported } = usePasskeySupport();

  const start = async (identifier: string) => {
    const { data, error } = await login(identifier, passkeySupported);
    if (error) return;

    if (passkeySupported && data.loginMethods?.includes('passkey')) {
      const passkey = await handlePasskeyLogin();
      if (!passkey.error) return;
    }

    await client.requestLoginEmailOtp();
    // navigate to your code screen; then client.verifyLoginEmailOtp(code)
  };
  // ...
}

useAuthorizedFetch() is a fetch for your own API that carries the access token and refreshes it once on a 401; a path resolves on apiHost, and a path under the adapter's mount (/auth/sessions) is sent as an adapter call:

const authorizedFetch = useAuthorizedFetch();
const plan = await authorizedFetch('/api/plan/mine').then(r => r.json());

useAuth() carries the session state and actions (user, credentials, isAuthenticated, loading, logout, refreshSession, registerPasskey, step-up and organization helpers) and useAuthClient() returns the headless client for the multi-step flows. The client is the same instance the session drives, which is what carries a sign-in from /login through its OTP or passkey step.

Every method returns a SeamlessAuthResult: { data, error: null } or { data: null, error }. Nothing throws for a failed request.

Passkeys

Native passkeys need the relying party to be an associated domain of the app: apple-app-site-association (webcredentials) and assetlinks.json hosted over HTTPS on the RP ID domain, an associatedDomains entitlement on iOS, and the app's signing certificate hash in the auth API's ORIGINS as android:apk-key-hash:<base64url> on Android. There is no localhost exemption on either platform. OTP and magic link work without any of that.

registerPasskey(describeDevice(Platform, 'My phone')) records the device rather than a user agent.

Magic links

Request one with client.requestMagicLink(), then poll client.checkMagicLink() every few seconds; the poll returns the session once the link has been opened anywhere. If the app also receives the link as a universal link, call client.verifyMagicLink(token) and then checkMagicLink().

OAuth

startOAuthLogin({ providerId, redirectUri }) returns the provider URL; open it with ports.oauthRedirect.open(url, redirectUri), which resolves with the callback's code and state, and finish with finishOAuthLogin. redirectUri must be registered with the provider and allowed by the auth API.

License

AGPL-3.0-only. See LICENSE.