Python SDK for the FaceVault identity verification API
Project description
FaceVault Python SDK
Python client for the FaceVault identity verification API — privacy-first KYC with liveness detection, face matching, and document verification.
Features
- Sync & async clients — use
FaceVaultClientorAsyncFaceVaultClient - 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 only —
http://URLs are rejected at init to prevent credentials leaking over plaintext - Key validation — empty or whitespace-only API keys raise
ValueErrorimmediately - Secret redaction —
Session.__repr__maskssession_tokenand URL tokens, safe for logging - Client redaction —
FaceVaultClient.__repr__masks the API key - Path traversal protection —
get_session()validates session IDs
What's new in 1.0.0
require_poaparameter oncreate_session()— per-session proof of address overridetrust_scoreandtrust_decisiononSessionStatus— unified 0-100 trust scorerequire_poa,poa,anti_spoofing,credentialonSessionStatustrust_score,trust_decision,sanctions_hit,poaonWebhookEventchallenge_nonceonSession— capture integrity nonce
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file facevault-1.0.1.tar.gz.
File metadata
- Download URL: facevault-1.0.1.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da3d5a1b4e0f3ff281af14267a778bea4beb94d6e6aba51d37278d219e4e8ff0
|
|
| MD5 |
b1980c2a21c14aa583e5f7bb1aa9d6c4
|
|
| BLAKE2b-256 |
b1b52bf2f9ecfadaddd751a5b3d671cca85f9f40bf7e7372dd873d2ee64fbc6f
|
Provenance
The following attestation bundles were made for facevault-1.0.1.tar.gz:
Publisher:
release.yml on khreechari/facevault-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
facevault-1.0.1.tar.gz -
Subject digest:
da3d5a1b4e0f3ff281af14267a778bea4beb94d6e6aba51d37278d219e4e8ff0 - Sigstore transparency entry: 1658738426
- Sigstore integration time:
-
Permalink:
khreechari/facevault-python@d9d7981ccb38d40468ff0ba49c01481104f85787 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/khreechari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9d7981ccb38d40468ff0ba49c01481104f85787 -
Trigger Event:
push
-
Statement type:
File details
Details for the file facevault-1.0.1-py3-none-any.whl.
File metadata
- Download URL: facevault-1.0.1-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
790b3d169a72830851792f39d1a77d870f7a4f22b1dd4fbf369203b6402d3a81
|
|
| MD5 |
f49c91ab363aa6de592edb206c7f876b
|
|
| BLAKE2b-256 |
7e8c5d92297662e5eda8f8ed3ed21936635a8bbfdded86fa28977149bbf6a47d
|
Provenance
The following attestation bundles were made for facevault-1.0.1-py3-none-any.whl:
Publisher:
release.yml on khreechari/facevault-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
facevault-1.0.1-py3-none-any.whl -
Subject digest:
790b3d169a72830851792f39d1a77d870f7a4f22b1dd4fbf369203b6402d3a81 - Sigstore transparency entry: 1658738474
- Sigstore integration time:
-
Permalink:
khreechari/facevault-python@d9d7981ccb38d40468ff0ba49c01481104f85787 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/khreechari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9d7981ccb38d40468ff0ba49c01481104f85787 -
Trigger Event:
push
-
Statement type: