Metadata-Version: 2.4
Name: webex-byova
Version: 0.2.0
Summary: Python SDK for Webex Contact Center BYOVA / BYODS — Data Sources, Service App tokens, Integration OAuth, and gRPC media server
Project-URL: Homepage, https://github.com/Joezanini/byova-sdk-python
Project-URL: Documentation, https://joezanini.github.io/byova-sdk-python/
Project-URL: Repository, https://github.com/Joezanini/byova-sdk-python
Author: Webex BYOVA SDK Contributors
License-Expression: MIT
License-File: LICENSE
Keywords: byods,byova,contact-center,grpc,media-server,virtual-agent,webex
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pyjwt[crypto]>=2.8.0
Provides-Extra: dev
Requires-Dist: grpcio-tools>=1.60; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'docs'
Provides-Extra: media
Requires-Dist: grpcio>=1.60; extra == 'media'
Requires-Dist: websockets>=12; extra == 'media'
Description-Content-Type: text/markdown

# webex-byova

Python SDK for **Webex Contact Center BYOVA** and the foundational **Bring Your Own Data Source (BYODS)** APIs.

Simplify Service App token management, Integration OAuth, DataSource CRUD, schema discovery, JWS verification, and BYOVA gRPC media streaming.

## Install

```bash
pip install webex-byova
```

For the gRPC media server (voice virtual agent streaming), install the optional dependencies:

```bash
pip install "webex-byova[media]"
```

## Quick start

```python
import asyncio
from webex_byova import BYOVA
from webex_byova.models import IntegrationCredentials, ServiceAppCredentials

sdk = BYOVA(
    integration=IntegrationCredentials(
        client_id="YOUR_INTEGRATION_CLIENT_ID",
        client_secret="YOUR_INTEGRATION_CLIENT_SECRET",
        redirect_uri="http://127.0.0.1:8765/callback",
    ),
    service_app=ServiceAppCredentials(
        client_id="YOUR_SERVICE_APP_CLIENT_ID",
        client_secret="YOUR_SERVICE_APP_CLIENT_SECRET",
    ),
)

async def main():
  # Developer authorizes Integration (not customer admin)
  await sdk.integration.aauthorize(open_browser=True)

  await sdk.webhooks.aensure_service_app_webhooks(
      target_url="https://your-app.example.com/webhooks/webex",
  )

asyncio.run(main())
```

After a customer admin authorizes your Service App in Control Hub, handle the webhook:

```python
result = await sdk.ahandle_service_app_webhook(webhook_json)
client = await sdk.aget_client_for_org(result.org_id)
sources = await client.data_sources.alist()
```

## Environment variables

```bash
export WEBEX_INTEGRATION_CLIENT_ID=...
export WEBEX_INTEGRATION_CLIENT_SECRET=...
export WEBEX_SA_CLIENT_ID=...
export WEBEX_SA_CLIENT_SECRET=...
export WEBEX_INTEGRATION_REDIRECT_URI=http://127.0.0.1:8765/callback
```

```python
sdk = BYOVA.from_env()
```

## Documentation

Full documentation: **[joezanini.github.io/byova-sdk-python](https://joezanini.github.io/byova-sdk-python/)**

Build and preview locally:

```bash
pip install -e ".[docs]"
mkdocs serve -f docs/mkdocs.yml   # http://127.0.0.1:8000
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup.

## License

MIT — see [LICENSE](LICENSE).
