
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@sudobility/auth_lib
Advanced tools
Firebase authentication library with configurable auth initialization, resilient network clients with automatic token refresh and logout handling, admin utilities, and React hooks for auth state management. Supports both web and React Native platforms.
bun add @sudobility/auth_lib
bun add react firebase @sudobility/di @sudobility/types @tanstack/react-query
# For React Native, also:
bun add @react-native-firebase/app @react-native-firebase/auth
import {
initializeFirebaseAuth,
useFirebaseAuthNetworkClient,
useSiteAdmin,
getFirebaseErrorMessage,
} from '@sudobility/auth_lib';
// Initialize Firebase Auth (after Firebase app is initialized)
const { app, auth } = initializeFirebaseAuth();
// In a React component: get an auth-aware network client
const networkClient = useFirebaseAuthNetworkClient({
onLogout: () => navigate('/login'),
});
// Check if user is a site admin
const { isSiteAdmin, isLoading } = useSiteAdmin({
networkClient,
baseUrl: 'https://api.example.com',
userId: user.uid,
token: idToken,
});
config/)| Export | Description |
|---|---|
initializeFirebaseAuth() | Initialize Firebase Auth (singleton) |
getFirebaseApp() | Get cached FirebaseApp instance |
getFirebaseAuth() | Get cached Auth instance |
isFirebaseConfigured() | Check if Firebase is initialized |
hooks/)| Export | Description |
|---|---|
useFirebaseAuthNetworkClient(options?) | Auth-aware NetworkClient with 401 retry and 403 logout |
createFirebaseAuthNetworkClient(platformNetwork?, options?) | Non-hook factory version |
useSiteAdmin(options) | Check site admin status via TanStack Query |
network/)| Export | Description |
|---|---|
FirebaseAuthNetworkService | Auth-aware network service (web and RN variants) |
utils/)| Export | Description |
|---|---|
getFirebaseErrorMessage(code) | Map Firebase error code to user-friendly message |
formatFirebaseError(error) | Extract and map error code in one call |
isFirebaseAuthError(error) | Check if error is a Firebase auth error |
admin/)| Export | Description |
|---|---|
parseAdminEmails(csv) | Parse comma-separated admin email string |
isAdminEmail(email, adminSet) | Check if email is in admin set |
createAdminChecker(csv) | Returns admin check function (deprecated) |
import resolves to dist/index.js (Firebase JS SDK)react-native condition resolves to dist/index.rn.js (@react-native-firebase)bun run build # Compile TypeScript to dist/
bun run dev # Watch mode build
bun test # Run tests with Vitest
bun run typecheck # Type-check without emitting
bun run lint # Lint with ESLint
bun run format # Format with Prettier
BUSL-1.1
FAQs
Firebase authentication utilities with token refresh handling
We found that @sudobility/auth_lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.