Metadata-Version: 2.1
Name: zkauth-sdk
Version: 1.0.0
Summary: Zero-knowledge proof authentication SDK for Python
Home-page: https://github.com/zkauth/zkauth-developer-platform
Author: ZKAuth Team
Author-email: ZKAuth Team <support@zkauth.com>
Project-URL: Homepage, https://github.com/zkauth/zkauth-developer-platform
Project-URL: Documentation, https://docs.zkauth.com
Project-URL: Repository, https://github.com/zkauth/zkauth-developer-platform.git
Project-URL: Bug Tracker, https://github.com/zkauth/zkauth-developer-platform/issues
Keywords: zkauth,zero-knowledge,authentication,cryptography,privacy,zk-snarks
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Provides-Extra: django
Provides-Extra: fastapi
Provides-Extra: dev

# ZKAuth Python SDK

Zero-knowledge proof authentication for Python applications.

## Installation

```bash
pip install zkauth-sdk
```

## Quick Start

### Basic Usage

```python
from zkauth import ZKAuthClient

client = ZKAuthClient(
    api_key="your-api-key",
    base_url="https://zkauth-engine.vercel.app"
)

# Sign up a new user
signup_result = await client.sign_up(
    email="user@example.com",
    password="secure-password"
)

# Sign in
signin_result = await client.sign_in(
    email="user@example.com",
    password="secure-password"
)

if signin_result.success:
    print(f"User authenticated: {signin_result.user.email}")
```

### Django Integration

```python
# settings.py
INSTALLED_APPS = [
    # ... other apps
    'zkauth.integrations.django',
]

ZKAUTH_CONFIG = {
    'API_KEY': 'your-api-key',
    'BASE_URL': 'https://zkauth-engine.vercel.app',
}

# views.py
from zkauth.integrations.django import zkauth_required

@zkauth_required
def protected_view(request):
    user = request.zkauth_user
    return JsonResponse({'user': user.email})
```

### FastAPI Integration

```python
from fastapi import FastAPI, Depends
from zkauth.integrations.fastapi import ZKAuthMiddleware, get_current_user

app = FastAPI()

# Add ZKAuth middleware
app.add_middleware(
    ZKAuthMiddleware,
    api_key="your-api-key",
    base_url="https://zkauth-engine.vercel.app"
)

@app.get("/protected")
async def protected_route(user = Depends(get_current_user)):
    return {"user": user.email}
```

## Features

- ✅ Async/await support
- ✅ Django and FastAPI integrations
- ✅ Type hints with Pydantic models
- ✅ Comprehensive error handling
- ✅ Session management
- ✅ Device fingerprinting
- ✅ Python 3.8+ support

## API Reference

See [python.md](./python.md) for complete API documentation.

## License

MIT
