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

@chipmobilesdk/rn-auth

v0.2.1

Published

Reusable Microsoft Entra External ID authentication for ChipMobileSdk-family React Native apps. The library is a **public OAuth2/OIDC client** (Authorization Code + PKCE, **no backend, no client secret**). Android presents **Continue with Google**, iOS

Readme

@chipmobilesdk/rn-auth

Reusable Microsoft Entra External ID authentication for ChipMobileSdk-family React Native apps. The library is a public OAuth2/OIDC client (Authorization Code + PKCE, no backend, no client secret). Android presents Continue with Google, iOS presents Continue with Apple, and either platform can also present Continue with Facebook; all start the same External ID sign-up/sign-in user flow, routed to the right social provider with a domain_hint. Google, Apple, and Facebook are federated inside the External ID tenant, so the app embeds no native social SDK and no Sign in with Apple entitlement. Each platform renders all of its configured providers as separate buttons in configuration order.

License: UNLICENSED. Published publicly for use by the owner's applications; no open-source license is granted.

  • Version: 0.2.0

  • Entrypoint: @chipmobilesdk/rn-auth

  • Single active account, session restore, local + global sign-out.

  • Per-resource delegated access tokens for Azure resources.

  • Group/role/claim access-tier evaluation that fails closed.

  • Tokens persist only in platform secure storage (Keychain / Keystore).

  • No i18n runtime dependency: user-facing copy is stable keys + English defaults.

Install (consuming app)

npm install @chipmobilesdk/rn-auth react-native-app-auth react-native-keychain
cd ios && pod install

react, react-native, react-native-app-auth, and react-native-keychain are peer dependencies. The two native libraries are only required by the default adapters — an app injecting custom ports may omit them.

See native setup for the iOS Info.plist URL scheme and the Android appAuthRedirectScheme Gradle placeholder.

Quick start

import {
  AuthProvider,
  createAuth,
  createAppAuthClient,
  createKeychainSecureStore,
  useAuth,
  useSignInProvider,
} from '@chipmobilesdk/rn-auth';

const auth = createAuth({
  authority: 'https://<tenant>.ciamlogin.com/<tenant>.onmicrosoft.com',
  clientId: '<public-client-id>',
  redirectUrl: 'com.yourapp://oauthredirect',
  scopes: ['openid', 'profile', 'offline_access'],
  providers: [
    { id: 'google', platforms: ['android'], domainHint: 'google.com', labelKey: 'auth.action.continueGoogle' },
    { id: 'apple', platforms: ['ios'], domainHint: 'apple.com', labelKey: 'auth.action.continueApple' },
    // Optional third provider, shown on both platforms after the platform-native one:
    { id: 'facebook', platforms: ['ios', 'android'], domainHint: 'facebook.com', labelKey: 'auth.action.continueFacebook' },
  ],
  resources: [{ key: 'storage', scopes: ['https://storage.azure.com/user_impersonation'] }],
  accessTierMapping: { premiumGroupObjectIds: ['<premium-group-object-id>'] },
  secureStore: createKeychainSecureStore(),
  authClient: createAppAuthClient(),
});

export const App = () => (
  <AuthProvider auth={auth}>
    <Screen />
  </AuthProvider>
);

Hooks: useAuth() (state + signIn/signOut/signOutGlobal/restore/requirePremium), useProfile(), useAccessTier(), useAccessToken(resourceKey), useSignInProviders() (all platform providers, in config order — map to one button each) and useSignInProvider() (first available, for a single-button UI).

Configuration contract (LIB-010)

The library accepts public values only. Provider secrets, Apple keys, and client secrets are configured in the External ID tenant, never in the app (FR-017).

| Section | Keys | |---------|------| | A — Tenant / client | authority, clientId, redirectUrl, scopes (include offline_access) | | B — Android Google | providers[google]: domainHint, platforms: ['android'], labelKey | | C — iOS Apple | providers[apple]: domainHint, platforms: ['ios'], labelKey | | C2 — Facebook (optional) | providers[facebook]: domainHint: 'facebook.com', platforms: ['ios','android'], labelKey: 'auth.action.continueFacebook', optional available | | D — Resources | resources[].key, resources[].scopes, resources[].displayName? | | E — Access tier | accessTierMapping.premiumGroupObjectIds (+ optional role names / claim matchers; display names are diagnostics-only) | | F — Ports | secureStore (required), authClient (optional), messages (optional copy override) |

Full contract: auth-config.md and public-api.md.

Tenant / provider prerequisite checklist (LIB-018)

These are external prerequisites (FR-013/FR-018) completed before the library can sign users in:

External ID tenant

  • [ ] Customer (CIAM) tenant created; sign-up/sign-in user flow configured.
  • [ ] App registration created as a public client; redirect URI added (must match the native scheme, e.g. com.yourapp://oauthredirect).
  • [ ] API permissions / scopes for each target Azure resource consented.
  • [ ] Premium group(s) created; record the group object id (not the name).
  • [ ] Groups (or roles) emitted in the token; plan for groups overage.

Google (federated in the tenant)

  • [ ] Google Cloud OAuth client configured; client id/secret stored in the tenant IdP config (never in the app).
  • [ ] Google added as an identity provider in the External ID user flow.

Apple (federated in the tenant)

  • [ ] Apple Services ID + Sign in with Apple key configured; stored in the tenant IdP config.
  • [ ] Apple added as an identity provider in the External ID user flow.
  • [ ] Note: Apple sign-in operational credentials expire on a schedule and must be rotated tenant-side.

Facebook (federated in the tenant — optional)

  • [ ] Facebook app created in Meta for Developers; App ID + App Secret stored in the tenant IdP config (never in the app).
  • [ ] Facebook added as an identity provider in the External ID user flow; domain_hint confirmed (expected facebook.com).
  • [ ] Facebook app OAuth redirect / valid OAuth domains match the tenant federation redirect.
  • [ ] iOS: because Facebook is a third-party login, keep Sign in with Apple offered on iOS (Apple guideline 4.8).
  • [ ] Update Apple App Privacy and Google Play Data Safety to include Facebook as an identity provider before release.

Security & privacy

  • Tokens and refresh artifacts persist only in SecureTokenStore (Keychain / Keystore). Access tokens are kept in memory only.
  • Access-tier decisions prefer stable group object ids; display names never grant access; missing/overage claims fail closed.
  • Diagnostics (AuthError) never contain secrets or token values.
  • Authentication and profile data are collected and transmitted to the identity providers and configured Azure resources — update Apple App Privacy and Google Play Data Safety before release.

Public API

Everything below is exported from @chipmobilesdk/rn-auth; deep imports into config/, core/, tokens/, oidc/, access/, diagnostics/, or react/ are unsupported.

  • Controller and configuration: createAuth, Auth, AuthConfig, CreateAuthOptions, AuthState, AuthStatus, RestoreStatus
  • Identity and access: Profile, ProviderConfig, ProviderIdentity, ResourceConfig, AccessTier, AccessTierMapping, AccessTokenResult, PremiumGateResult, evaluateAccessTier, failClosedTier
  • Ports and default adapters: SecureTokenStore, createKeychainSecureStore, AUTH_STORAGE_KEY, OidcAuthClient, createAppAuthClient and the public OIDC request/token types
  • React: AuthProvider, useAuth, useProfile, useAccessTier, useAccessToken, useSignInProvider, useSignInProviders
  • Diagnostics and copy: AuthError, AuthConfigError, isAuthError, redact, DEFAULT_MESSAGES, resolveMessages and their public code/message types

Compatibility and validation

React ≥19 · React Native ≥0.85 · react-native-app-auth ≥8 · react-native-keychain ≥10 · iOS + Android · Node ≥22.11 for tooling.

The demo integration lives in src/screens/AuthDemoScreen.tsx. Run from the repository root:

npm run typecheck:auth
npm run pack:auth
npm run validate:auth

Distribution and license

Published as a public npm package (publishConfig.access: public) for use by the owner's applications. License: UNLICENSED; no open-source license is granted.