Metadata-Version: 2.4
Name: verixo
Version: 0.1.0
Summary: Official Python SDK for the Verixo OTP-as-a-Service API
Project-URL: Homepage, https://verifiedcore.com
Project-URL: Repository, https://github.com/titicodes/verixo
License-Expression: MIT
Keywords: otp,phone-verification,sms-verification,verixo
Requires-Python: >=3.8
Requires-Dist: requests>=2.27
Requires-Dist: websocket-client>=1.6
Description-Content-Type: text/markdown

# verixo

Official Python SDK for the [Verixo](https://verifiedcore.com) OTP-as-a-Service API.

## Install

```bash
pip install verixo
```

## Quickstart

```python
import os
import verixo

client = verixo.Client(os.environ["VC_API_KEY"])

result = client.numbers.search(
    service_slug="whatsapp",
    country_code="NG",
    min_score=80,
    limit=5,
)

session = client.numbers.purchase(
    service_slug="whatsapp",
    country_code="NG",
)

def handle(push):
    print(f"OTP: {push.otp} in {push.latency_ms}ms")

client.subscribe(session.session_token, handle)
```

Note: `purchase()` takes `service_slug` + `country_code`, not a specific
`number_id` -- the server picks the best available number by Health Score at
purchase time, since a candidate returned by `search()` may already be gone
by the time you'd reference it back.

## Polling instead of real-time push

`subscribe()` runs a background thread holding a persistent WebSocket
connection, which isn't always practical (e.g. one-shot scripts, serverless
functions). Use `sessions.wait_for_otp()` instead:

```python
result = client.sessions.wait_for_otp(session.session_token)
if result.status == "DELIVERED":
    print(result.otp_code)
```

## Errors

All non-2xx responses raise `verixo.VerixoError` with `.status`, and usually
`.code`/`.detail` from the API's error body:

```python
from verixo import VerixoError

try:
    client.numbers.purchase(service_slug="whatsapp", country_code="NG")
except VerixoError as err:
    if err.status == 402:
        print("Insufficient wallet balance")
```

## Requirements

Python 3.8+.

## Development

```bash
python -m venv .venv
.venv/Scripts/activate   # or `source .venv/bin/activate` on macOS/Linux
pip install -e .
python examples/quickstart.py   # requires VC_API_KEY env var, see file header
```
