Metadata-Version: 2.4
Name: webex-byova
Version: 0.1.1
Summary: Python SDK for Webex Contact Center BYOVA / BYODS — Data Sources, Service App tokens, and Integration OAuth
Project-URL: Homepage, https://github.com/Joezanini/byova-sdk-python
Project-URL: Documentation, https://github.com/Joezanini/byova-sdk-python#readme
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,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: 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'
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, and JWS verification.

## Install

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

## 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

See the [docs/](docs/) directory and [CONTRIBUTING.md](CONTRIBUTING.md).

## License

MIT — see [LICENSE](LICENSE).
