šŸŽ‰ @facesmash/sdk v2.0.0 is now available on npm — Read the docs →
FaceSmash Docs

Sign in with FaceCard

FaceCard is a new authentication primitive — like "Sign in with Google," but using your face instead of a third-party account.

What is FaceCard?

FaceCard is a new type of authentication. Instead of relying on passwords, OAuth providers, or device-locked biometrics, FaceCard lets users sign in to any website or app by looking at their camera.

Think of it like "Sign in with Google" or "Sign in with Apple" — but instead of trusting a third-party account, the user authenticates with their face. No passwords, no OAuth tokens, no single-provider lock-in. Your face is your credential, and it works everywhere.

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│                                     │
│     Sign in to your account         │
│                                     │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  │  email@example.com            │  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  │  ••••••••                     │  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  │         Sign in               │  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
│                                     │
│           ── or ──                  │
│                                     │
│  ╔═══════════════════════════════╗  │
│  ā•‘   šŸ‘¤ Sign in with FaceCard   ā•‘  │
│  ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•  │
│                                     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Users click "Sign in with FaceCard," glance at their camera, and they're authenticated in under 2 seconds.


Why FaceCard?

The Problem with Existing Auth

Every current authentication method has significant trade-offs:

  • Passwords are forgettable, phishable, reused across sites, and create friction.
  • OAuth / Social login (Google, Apple, GitHub) ties your identity to a third-party ecosystem. If that provider goes down or changes their policies, your users lose access.
  • Face ID / Windows Hello only work within their respective ecosystems. Switch from iPhone to a work laptop? You're back to passwords.
  • Passkeys are promising but have inconsistent browser/device support and confuse users who don't understand the concept.

What FaceCard Does Differently

FaceCard runs entirely in the browser. It uses a 128-dimensional biometric signature extracted client-side using WebGL-accelerated neural networks. No photos are stored. No third-party dependencies. No special hardware required beyond a standard webcam.

AdvantageHow
UniversalWorks on any device with a camera and a modern browser — iOS, Android, Mac, Windows, Linux
PrivateAll face processing happens client-side. Only encrypted math vectors are transmitted
Self-containedNo dependency on Google, Apple, or any OAuth provider
FastAverage authentication time: 1.8 seconds
Secure128-dimensional biometric signatures can't be guessed, phished, or reused

Comparison: FaceCard vs Other Auth Methods

FeatureFaceCardPasswordsPasskeysFace IDOAuth / Social
Nothing to rememberāœ…āŒāœ…āœ…āœ…
Cross-platformāœ…āœ…āš ļø PartialāŒ Apple onlyāœ…
No third-party dependencyāœ…āœ…āš ļø PartialāŒāŒ
Phishing resistantāœ…āŒāœ…āœ…āš ļø Partial
Works on any deviceāœ…āœ…āš ļø PartialāŒāœ…
No special hardwareāœ…āœ…āŒ Needs FIDO keyāŒ Needs TrueDepthāœ…
Biometric securityāœ…āŒāš ļø Optionalāœ…āŒ
Sub-2 second authāœ…āŒāœ…āœ…āŒ
No account lockout riskāœ…āŒāš ļø Partialāœ…āš ļø Partial
Privacy-first (no tracking)āœ…āš ļø Partialāœ…āœ…āŒ
Works in any browserāœ…āœ…āš ļø PartialāŒāœ…
Self-hostableāœ…āœ…āŒāŒāŒ

Key Takeaways

  • Passwords fail on almost every modern security metric — phishable, forgettable, slow.
  • Passkeys are a step forward but have fragmented device support and confuse non-technical users.
  • Face ID is excellent UX but locked to Apple devices. Switch ecosystems and you lose it.
  • OAuth is convenient but creates vendor dependency and shares user data with third parties.
  • FaceCard combines the UX of Face ID, the universality of passwords, and the privacy of passkeys — without their respective downsides.

How FaceCard Works Under the Hood

1. User clicks "Sign in with FaceCard"

The website or app renders a FaceCard button using the @facesmash/sdk:

import { FaceSmashProvider, FaceLogin } from '@facesmash/sdk/react';

<FaceSmashProvider config={{ apiUrl: 'https://api.facesmash.app' }}>
  <FaceLogin
    onResult={(r) => r.success && redirect('/dashboard')}
  />
</FaceSmashProvider>

2. Camera activates, face is captured

The SDK activates the user's camera via getUserMedia and captures 3+ frames. Each frame is analyzed for quality (lighting, blur, face size, pose).

3. Biometric signature extracted

The best-quality frame is processed through 5 neural networks running client-side via TensorFlow.js:

Camera frame
  → SSD MobileNet v1 (face detection)
  → FaceLandmark68Net (68-point facial landmark mapping)
  → FaceRecognitionNet (128-D descriptor extraction)
  → Quality analysis (lighting, blur, confidence)
  → Liveness detection (anti-spoofing)

The result is a 128-dimensional numeric vector — a compact mathematical signature of the user's face. This is the FaceCard.

4. Signature compared server-side

The 128-D vector is sent (encrypted) to the server, where it's compared against stored vectors using cosine similarity with adaptive thresholds. If the match exceeds the threshold, the user is authenticated.

5. Adaptive learning

Each successful login optionally stores a new face template, building a richer model of the user's appearance under different conditions (lighting, angles, aging). Accuracy improves over time.


Privacy & Security

FaceCard was designed with privacy as a core constraint, not an afterthought:

  • No photos stored — Raw camera frames never leave the browser. Only compact 128-D numeric vectors are transmitted.
  • Client-side processing — All neural network inference happens in the browser via WebGL. The server never sees raw biometric data.
  • AES-256 encryption — Stored face vectors are encrypted at rest.
  • Non-reversible — It's mathematically impossible to reconstruct a face image from a 128-D descriptor vector.
  • No third-party data sharing — Unlike OAuth, FaceCard doesn't share any user data with external providers.
  • Self-hostable — Run your own PocketBase instance. Your data, your infrastructure, your rules.

Adding FaceCard to Your App

React

npm install @facesmash/sdk
import { FaceSmashProvider, FaceLogin } from '@facesmash/sdk/react';

function LoginPage() {
  return (
    <FaceSmashProvider config={{ apiUrl: 'https://api.facesmash.app' }}>
      <div>
        <h1>Sign in</h1>
        {/* Traditional login form here */}

        <p>— or —</p>

        {/* FaceCard button */}
        <FaceLogin
          onResult={(result) => {
            if (result.success) {
              window.location.href = '/dashboard';
            }
          }}
        />
      </div>
    </FaceSmashProvider>
  );
}

Vanilla JavaScript

import { createFaceSmash } from '@facesmash/sdk';

const client = createFaceSmash({ apiUrl: 'https://api.facesmash.app' });
await client.init();

// When user clicks "Sign in with FaceCard"
const result = await client.login(capturedImages);
if (result.success) {
  console.log(`Welcome back, ${result.user.name}!`);
}

Next Steps

On this page