Skip to main content

One post tagged with "firebase-auth"

View All Tags

Introducing PasskeyMe's New JavaScript and React SDKs - Firebase Auth for the Passkey Era

ยท 9 min read

We're excited to announce the launch of PasskeyMe's completely redesigned JavaScript and React SDKs! These new SDKs bring a Firebase Auth-like developer experience to passkey authentication using hosted authentication pages, making it easier than ever to integrate secure, passwordless authentication into your web applications.

๐Ÿ†• What's New?โ€‹

@passkeyme/auth - Core JavaScript/TypeScript SDKโ€‹

Our new core SDK provides a complete authentication solution using PasskeyMe's hosted authentication pages:

import { PasskeymeAuth } from '@passkeyme/auth';

const auth = new PasskeymeAuth({
appId: 'your-app-id',
baseUrl: 'https://auth.passkeyme.com',
mode: 'hosted' // Uses your branded hosted auth pages
});

// Redirect to hosted auth page (all methods)
auth.redirectToLogin();

// Redirect to specific OAuth provider
auth.redirectToOAuth('google');

// Handle return from hosted auth
const user = await auth.handleAuthCallback();

@passkeyme/react-auth - React Integration SDKโ€‹

The React SDK brings hosted authentication directly into your React components with simple hooks:

import { 
PasskeymeProvider,
usePasskeyme
} from '@passkeyme/react-auth';

function App() {
return (
<PasskeymeProvider config={{ appId: 'your-app-id' }}>
<AuthenticatedApp />
</PasskeymeProvider>
);
}

function LoginPage() {
const { redirectToLogin, redirectToOAuth } = usePasskeyme();

return (
<div>
<button onClick={() => redirectToLogin()}>
๐Ÿ” Sign In (All Methods)
</button>
<button onClick={() => redirectToOAuth('google')}>
๐ŸŒ Continue with Google
</button>
</div>
);
}

๐ŸŽฏ Why Hosted Authentication?โ€‹

The Firebase Auth Experience, But Betterโ€‹

While Firebase Auth has set the gold standard for authentication SDKs, it requires complex setup for OAuth providers and lacks comprehensive passkey support. We created something that's even simpler while being more powerful.

Our Solution: Hosted Pages + Self-Hosted Controlโ€‹

PasskeyMe's hosted authentication approach combines the best of all worlds:

  • โœ… Zero Configuration: No OAuth app setup, no complex SDK configuration
  • โœ… Centralized Branding: Your logo, colors, and styling across all apps
  • โœ… Passkey-First: Native WebAuthn/passkey support built from the ground up
  • โœ… Self-Hosted: Full control over your authentication infrastructure
  • โœ… TypeScript-First: Complete type safety and excellent developer experience
  • โœ… Framework Agnostic: Works with React, Vue, Angular, Next.js, or vanilla JavaScript

๐Ÿš€ Key Featuresโ€‹

๐ŸŽจ Hosted Authentication Pagesโ€‹

Your users see beautifully designed, branded authentication pages:

// Your app redirects to hosted auth page
auth.redirectToLogin();

// Users see YOUR branded page with:
// - Your logo and colors
// - Configured OAuth providers (Google, GitHub, etc.)
// - Passkey authentication
// - Username/password forms
// - Custom styling and messaging

๐Ÿ” Comprehensive Authentication Methodsโ€‹

All methods available on your hosted pages:

// Direct to general auth page (shows all enabled methods)
auth.redirectToLogin();

// Direct to specific OAuth provider
auth.redirectToOAuth('google');
auth.redirectToOAuth('github');

// Direct to specific auth method
auth.redirectToLogin({ authMethod: 'passkey' });
auth.redirectToLogin({ authMethod: 'password' });

Modern React Integrationโ€‹

// Authentication state management
const { user, isAuthenticated, loading, error } = usePasskeyme();

// Pre-built UI components
<PasskeyLoginButton>๐Ÿ” Login with Passkey</PasskeyLoginButton>
<LoginButton provider="google">Login with Google</LoginButton>
<UserProfile editable={true} />
<ProtectedRoute><Dashboard /></ProtectedRoute>

Automatic Token Managementโ€‹

  • Secure token storage in browser
  • Automatic token refresh
  • HTTP interceptors for API calls
  • CSRF protection and security best practices

Production-Ready Featuresโ€‹

  • Comprehensive error handling
  • Loading states and user feedback
  • Customizable UI components
  • Mobile-responsive design
  • Accessibility (WCAG) compliance

๐Ÿ”„ Easy Migrationโ€‹

From Firebase Authโ€‹

โšก Automatic Token Managementโ€‹

No more manually handling JWTs:

// Tokens stored securely and refreshed automatically
const token = await auth.getAccessToken();

// Use with any HTTP client
fetch('/api/protected', {
headers: { 'Authorization': `Bearer ${token}` }
});

๐Ÿ›ก๏ธ Protected Routes Made Simpleโ€‹

// React Router protection
<Route path="/dashboard" element={
<ProtectedRoute>
<Dashboard />
</ProtectedRoute>
} />

// Next.js protection
function ProtectedPage() {
const { isAuthenticated, loading } = usePasskeyme();

if (loading) return <Spinner />;
if (!isAuthenticated) return <Navigate to="/login" />;

return <Dashboard />;
}

๐Ÿ”„ Seamless Migrationโ€‹

From Firebase Authโ€‹

The API is intentionally similar for easy migration:

// Firebase Auth (old)
import { signInWithEmailAndPassword } from 'firebase/auth';
await signInWithEmailAndPassword(auth, email, password);

// PasskeyMe (new)
import { PasskeymeAuth } from '@passkeyme/auth';
const auth = new PasskeymeAuth(config);
auth.redirectToLogin({ authMethod: 'password' });

From Auth0โ€‹

// Auth0 (old)
const { user, isAuthenticated, loginWithRedirect } = useAuth0();

// PasskeyMe (new)
const { user, isAuthenticated, redirectToLogin } = usePasskeyme();

The transition is seamless, but you gain hosted auth pages, native passkey support, and eliminate vendor lock-in!

๐ŸŽจ Hosted Auth Page Customizationโ€‹

Your hosted authentication pages are fully customizable through the PasskeyMe dashboard:

๐ŸŽฏ Brand Your Experienceโ€‹

  • Upload your logo and set brand colors
  • Customize fonts and styling
  • Add custom messaging and copy
  • Set your own custom domain

โš™๏ธ Configure Auth Methodsโ€‹

  • Enable/disable passkeys, OAuth providers, username/password
  • Set up OAuth apps (Google, GitHub, Facebook, etc.)
  • Configure passkey settings and policies
  • Set password requirements

๐Ÿ“ฑ Mobile-Optimized Designโ€‹

  • Responsive design works perfectly on all devices
  • Native mobile app integration via deep links
  • Progressive Web App (PWA) support

๐Ÿ›ก๏ธ Security & Performanceโ€‹

๐Ÿ”’ Enterprise-Grade Securityโ€‹

  • OAuth secrets managed server-side (never exposed to client)
  • Automatic security headers and CSRF protection
  • SOC 2 Type II compliant infrastructure
  • Regular security audits and penetration testing

โšก Lightning-Fast Performanceโ€‹

  • CDN-hosted assets for global speed
  • Minimal bundle size (< 50KB gzipped)
  • Optimized for Core Web Vitals
  • Automatic code splitting and lazy loading

Built-in Securityโ€‹

  • Automatic CSRF protection
  • Secure token storage with encryption
  • XSS protection for token handling
  • Secure HTTP-only cookie support
  • Token expiration and refresh management

Performance Optimizedโ€‹

  • Tree-shakable modules for minimal bundle size
  • Lazy loading of authentication components
  • Optimized re-rendering with React hooks
  • Efficient token caching and management

๐Ÿ“ฑ Real-World Exampleโ€‹

Here's a complete authentication flow in just a few lines:

import React from 'react';
import {
PasskeymeProvider,
usePasskeyme,
PasskeyLoginButton,
LoginButton,
UserProfile
} from '@passkeyme/react-auth';

const authConfig = {
apiUrl: process.env.REACT_APP_PASSKEYME_API_URL,
clientId: process.env.REACT_APP_PASSKEYME_CLIENT_ID,
};

function App() {
return (
<PasskeymeProvider config={authConfig}>
<AuthFlow />
</PasskeymeProvider>
);
}

function AuthFlow() {
const { user, isAuthenticated, loading } = usePasskeyme();

if (loading) return <div>Loading...</div>;

if (isAuthenticated) {
return (
<div>
<h1>Welcome back!</h1>
<UserProfile />
</div>
);
## ๐Ÿ“ Complete React Example

Here's how simple it is to add authentication to your React app:

```tsx
import { PasskeymeProvider, usePasskeyme } from '@passkeyme/react-auth';

const authConfig = {
appId: 'your-app-id',
baseUrl: 'https://auth.passkeyme.com',
mode: 'hosted'
};

function App() {
return (
<PasskeymeProvider config={authConfig}>
<AuthenticatedApp />
</PasskeymeProvider>
);
}

function AuthenticatedApp() {
const { isAuthenticated, redirectToLogin } = usePasskeyme();

if (!isAuthenticated) {
return (
<div>
<h1>Welcome to My App</h1>
<button onClick={() => redirectToLogin()}>
๐Ÿ” Sign In
</button>
</div>
);
}

return (
<div>
<h1>You're logged in!</h1>
<Dashboard />
</div>
);
}

That's it! Your users will see your beautifully branded hosted authentication page with all configured auth methods.

๐Ÿš€ Getting Startedโ€‹

Installationโ€‹

# Core SDK (works with any framework)
npm install @passkeyme/auth

# React SDK (includes core SDK)
npm install @passkeyme/react-auth @passkeyme/auth

Quick Setupโ€‹

  1. Configure your provider:
import { PasskeymeProvider } from '@passkeyme/react-auth';

<PasskeymeProvider config={{
appId: 'your-app-id', // From PasskeyMe dashboard
mode: 'hosted' // Uses hosted auth pages
}}>
<App />
</PasskeymeProvider>
  1. Use the hook:
const { user, redirectToLogin, isAuthenticated } = usePasskeyme();
  1. Add login buttons:
<button onClick={() => redirectToLogin()}>Sign In</button>

5-Minute Setup Guideโ€‹

  1. Create a PasskeyMe account at passkeyme.com
  2. Set up your app in the dashboard (configure branding, OAuth providers)
  3. Install the SDK and add the provider to your React app
  4. Add login buttons that redirect to hosted auth pages
  5. Handle the callback when users return from authentication

๐ŸŽฏ Why Choose PasskeyMe?โ€‹

vs. Firebase Authโ€‹

  • โœ… Native passkey support (Firebase requires custom implementation)
  • โœ… Self-hosted (no vendor lock-in)
  • โœ… Hosted auth pages (easier setup, better UX)
  • โœ… More OAuth providers with simpler configuration

vs. Auth0โ€‹

  • โœ… More affordable (especially for growing teams)
  • โœ… Passkey-first design (Auth0 added passkeys as an afterthought)
  • โœ… Self-hosted option (complete data control)
  • โœ… Better developer experience (simpler APIs)

vs. Clerkโ€‹

  • โœ… Self-hosted infrastructure (vs. SaaS-only)
  • โœ… More comprehensive passkey support
  • โœ… Framework agnostic (works with any JavaScript framework)
  • โœ… Enterprise-ready (SOC 2, GDPR compliant)

๐Ÿ”ฎ What's Next?โ€‹

We're just getting started! Coming soon:

  • ๐Ÿ”„ Direct Authentication Mode: For developers who want custom UI components without hosted pages
  • ๐Ÿ“ฑ React Native SDK: Native mobile authentication with passkeys and biometrics
  • ๐ŸŒ Vue.js & Angular SDKs: First-class support for all major frameworks
  • ๐Ÿ”Œ Webhook System: Real-time auth events for your backend systems
  • ๐Ÿ“Š Advanced Analytics: User authentication insights and security monitoring

๐ŸŽ‰ Join the Passkey Revolutionโ€‹

The future of web authentication is here, and it's passwordless.

With PasskeyMe's new SDKs, you can give your users the security and convenience of passkeys while maintaining the familiar, reliable developer experience you expect from modern authentication libraries.

Ready to get started?โ€‹

The passwordless future starts today. Let's build it together! ๐Ÿš€

๐Ÿ”ฎ What's Next?โ€‹

These new SDKs are just the beginning! Here's what's coming next:

  • @passkeyme/vue-auth - Vue.js integration
  • @passkeyme/react-native-auth - React Native mobile apps
  • @passkeyme/node-auth - Server-side Node.js integration
  • @passkeyme/flutter-auth - Flutter mobile apps
  • Advanced UI components - Forms, modals, onboarding flows
  • Theme system - Pre-built design systems and themes

๐Ÿ“š Resourcesโ€‹

๐Ÿค Community & Supportโ€‹

We're building PasskeyMe to be the authentication solution that developers actually want to use. Your feedback is crucial:

๐ŸŽ‰ Try It Today!โ€‹

The new PasskeyMe JavaScript and React SDKs are available now. Whether you're building a new application or looking to upgrade your existing authentication system, we've made it easier than ever to add secure, modern authentication to your web applications.

Get started today and give your users the passwordless authentication experience they deserve!

npm install @passkeyme/react-auth @passkeyme/auth

Happy coding! ๐Ÿš€


PasskeyMe - Secure authentication for the modern web