Skip to main content

FaceVault Python SDK

PyPI version Python versions License: MIT Tests CI

Python client for the FaceVault identity verification API — privacy-first KYC with liveness detection, face matching, and document verification.

Features

  • Sync & async clients — use FaceVaultClient or AsyncFaceVaultClient
  • Webhook verification — HMAC-SHA256 signature validation
  • Typed models — dataclasses for sessions, status, and webhook events
  • Secure by default — HTTPS enforced, API keys validated, secrets redacted from logs
  • Lightweight — only depends on httpx

Installation

pip install facevault

Quick start

Sync

from facevault import FaceVaultClient

client = FaceVaultClient("fv_live_your_api_key")

# Create a verification session
session = client.create_session(external_user_id="user-123")
print(session.webapp_url)  # Send this URL to your user

# With proof of address required
session = client.create_session(external_user_id="user-123", require_poa=True)

# Check session status
status = client.get_session(session.session_id)
print(status.status)           # "in_progress", "passed", "failed", "review"
print(status.trust_score)      # 0-100 trust score
print(status.trust_decision)   # "accept", "review", "reject"

client.close()

Async

from facevault import AsyncFaceVaultClient

async def verify_user():
    async with AsyncFaceVaultClient("fv_live_your_api_key") as client:
        session = await client.create_session(external_user_id="user-123")
        print(session.webapp_url)

Webhook verification

from facevault import verify_signature, parse_event

# Verify the webhook signature
body = request.body
signature = request.headers["X-FaceVault-Signature"]

if verify_signature(body, signature, secret="your_webhook_secret"):
    event = parse_event(body)
    print(event.event)             # "verification.completed"
    print(event.session_id)
    print(event.face_match_passed)
    print(event.trust_score)       # 0-100
    print(event.trust_decision)    # "accept", "review", "reject"
    print(event.sanctions_hit)     # True/False

Error handling

from facevault import FaceVaultClient, AuthError, NotFoundError, RateLimitError

client = FaceVaultClient("fv_live_your_api_key")

try:
    session = client.get_session("nonexistent")
except AuthError:
    print("Invalid API key")
except NotFoundError:
    print("Session not found")
except RateLimitError:
    print("Too many requests")

Security

The SDK enforces security best practices out of the box:

  • HTTPS onlyhttp:// URLs are rejected at init to prevent credentials leaking over plaintext
  • Key validation — empty or whitespace-only API keys raise ValueError immediately
  • Secret redactionSession.__repr__ masks session_token and URL tokens, safe for logging
  • Client redactionFaceVaultClient.__repr__ masks the API key
  • Path traversal protectionget_session() validates session IDs

What's new in 1.0.1

  • Webhook signature verification now HMACs the raw request body instead of re-serializing the parsed JSON. The old approach couldn't reproduce the server's exact signed bytes for payloads containing non-ASCII characters (names, addresses) or whole-number floats, so valid webhooks could be silently rejected. Verification is now byte-exact — pass the body exactly as received.
  • README + examples now document the webhook header as X-FaceVault-Signature (the API has always sent this; v1.0.0 docs incorrectly showed X-Signature).
  • Reusable identity credentials (/credentials/*) are noted in the Roadmap section — these are planned for the v2 SDK line alongside FacePass / FaceKey, not v1.x.

Documentation

Roadmap

The FaceVault platform also offers reusable identity credentials ("verify once, prove forever" — credential challenge / verify / renew / status). These endpoints aren't wrapped by this SDK yet; they're planned for a future release. Until then, call them directly via the REST API.

Contributing

See CONTRIBUTING.md. One topic per PR; update CHANGELOG.md under ## [Unreleased].

Reporting a vulnerability

Please do not open public issues for security vulnerabilities. See SECURITY.md or email security@facevault.id.

Changelog

See CHANGELOG.md.

License

MIT — © Kaditham Holdings Pte Ltd

Release files for facevault 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for facevault 1.0.2
File Size Uploaded
facevault-1.0.2.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for facevault 1.0.2
File Interpreter ABI Platform
facevault-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.5 kB

Release files / facevault-1.0.2.tar.gz

Download URL facevault-1.0.2.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b26a1ea19296ce71c97fc0ed63b15bf05a97a0048840fc381485a73fa21ced7e
BLAKE2b-256 checksum
How to use checksums
ad035bfb2fc0d8c6943b8fe8342848f7e64b24b6c712f3e20425326f0b1b1308
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release files / facevault-1.0.2-py3-none-any.whl

Download URL facevault-1.0.2-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f017f03e962b1866e4e304cc7ed676887b834859014eb7eccfc4d1f8fca84b9f
BLAKE2b-256 checksum
How to use checksums
2eb679844f1688f522960b0c88fc62c4ecdff2ae3ea35f57df1260c58c9882fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page