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

@credocentral/e-identity-react-native

v1.0.2

Published

React Native SDK for e-identity OAuth2/OIDC authentication with MFA and passkey support

Readme

@credocentral/e-identity-react-native

React Native SDK for e-identity — OAuth2/OIDC authentication with MFA and passkey support.

Features

  • OAuth2 Authorization Code + PKCE login via react-native-app-auth (in-app browser)
  • Secure token storage via react-native-keychain (iOS Keychain / Android Keystore)
  • Automatic token refresh
  • MFA: TOTP, Email OTP, SMS OTP, passkey challenge & enrollment
  • Recovery code fallback
  • Forced password-change flow
  • Pre-built screen components (navigation-agnostic, callback-based)
  • Passkey native modules: iOS 16+ (ASAuthorizationController) · Android API 28+ (CredentialManager)

Installation

npm install @credocentral/e-identity-react-native react-native-app-auth react-native-keychain react-native-get-random-values

iOS

cd ios && pod install

Add the redirect scheme to Info.plist (for react-native-app-auth):

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>com.yourapp.auth</string>
    </array>
  </dict>
</array>

Register the native module in your AppDelegate by adding EIdentityRNPackage to the packages list (auto-linking handles this in React Native 0.60+).

Android

Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/>

Add the redirect activity for react-native-app-auth:

<activity android:name="net.openid.appauth.RedirectUriReceiverActivity" android:exported="true">
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="com.yourapp.auth"/>
  </intent-filter>
</activity>

Quick Start

import { EIdentityProvider, useEIdentity } from '@credocentral/e-identity-react-native';

const config = {
  issuerUrl: 'https://id.example.com',
  appId: 'your-app-uuid',
  redirectScheme: 'com.yourapp.auth',
};

export function App() {
  return (
    <EIdentityProvider config={config}>
      <Navigator />
    </EIdentityProvider>
  );
}

function HomeScreen() {
  const { user, isAuthenticated, login, logout } = useEIdentity();
  if (!isAuthenticated) return <Button title="Sign in" onPress={login} />;
  return (
    <View>
      <Text>Welcome, {user?.firstName}</Text>
      <Button title="Sign out" onPress={logout} />
    </View>
  );
}

Guards

import { EIdentityGuard, MfaChallengeGate, ForcedPasswordChangeGate } from '@credocentral/e-identity-react-native';

// Redirect to login if not authenticated
<EIdentityGuard onUnauthenticated={() => navigation.replace('Login')}>
  <HomeScreen />
</EIdentityGuard>

// Block access until MFA is complete
<MfaChallengeGate onMfaRequired={() => navigation.navigate('MfaChallenge', { challengeToken })}>
  <SecureScreen />
</MfaChallengeGate>

// Block access until password is changed
<ForcedPasswordChangeGate onChangeRequired={() => navigation.replace('ChangePassword')}>
  <HomeScreen />
</ForcedPasswordChangeGate>

Pre-built Screens

All screens are navigation-agnostic and accept callback props.

import {
  TotpChallengeScreen,
  OtpChallengeScreen,
  RecoveryCodeScreen,
  PasskeyChallengeScreen,
  TotpEnrollScreen,
  PasskeyEnrollScreen,
  ForcePasswordChangeScreen,
} from '@credocentral/e-identity-react-native';

// Use EIdentityRNClient from context or create one directly
const { client } = useEIdentityClient(); // or: new EIdentityRNClient({ config })

<TotpChallengeScreen
  client={client}
  challengeToken={route.params.challengeToken}
  onSuccess={(tokens) => navigation.replace('Home')}
  onUseRecovery={() => navigation.navigate('RecoveryCode', { challengeToken })}
/>

<ForcePasswordChangeScreen
  client={client}
  onSuccess={() => navigation.replace('Home')}
/>

Hooks

import { useMfaChallenge, useForcePasswordChange } from '@credocentral/e-identity-react-native';

// Build a custom MFA challenge UI
const { status, error, verifyTotp, verifyOtp, resendOtp, verifyRecovery, authenticateWithPasskey } =
  useMfaChallenge(client, challengeToken);

// Build a custom password change UI
const { isChanging, error, changePassword } = useForcePasswordChange(client);

Client API

| Method | Description | |---|---| | initialize() | Load persisted session; auto-refresh if expired | | login() | PKCE login via in-app browser | | logout() | Revoke + clear session | | getValidToken() | Return a non-expired access token (refreshes if needed) | | verifyTotpChallenge(token, code) | Verify TOTP code | | verifyOtpChallenge(token, code) | Verify email/SMS OTP | | resendOtpChallenge(token) | Resend OTP; returns masked destination | | verifyRecoveryCode(token, code) | Verify recovery code | | authenticateWithPasskey(token) | Combined passkey assertion flow | | enrollTotpOptions() | Fetch TOTP enrollment options (requires auth) | | confirmTotpEnrollment(setupToken, code) | Confirm TOTP; returns recovery codes | | enrollPasskey() | Combined passkey registration flow | | listMfaMethods() | List enrolled MFA methods | | regenerateRecoveryCodes() | Generate new recovery codes | | changePassword(current, new) | Change password (clears forcePasswordChange) |

Requirements

  • React Native 0.73+
  • iOS 13+ (passkeys require iOS 16+)
  • Android API 21+ (passkeys require API 28+)

License

MIT