Metadata-Version: 2.4
Name: realtimex-sdk
Version: 1.0.0
Summary: Python SDK for building Local Apps that integrate with RealtimeX
Project-URL: Homepage, https://github.com/realtimex/rtx-local-app-sdk
Project-URL: Documentation, https://docs.realtimex.ai/local-apps
Project-URL: Repository, https://github.com/realtimex/rtx-local-app-sdk
Author-email: RealtimeX Team <team@realtimex.ai>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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
Requires-Python: >=3.8
Requires-Dist: httpx>=0.25.0
Requires-Dist: supabase>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# RealtimeX Local App SDK - Python

Python SDK for building Local Apps that integrate with RealtimeX.

## Installation

```bash
pip install realtimex-sdk
```

## Prerequisites

Before using this SDK, ensure your Supabase database is set up:

1. Open **RealtimeX Main App** → **Local Apps** → Your App → **Configure**
2. Enter your Supabase **URL** and **Anon Key**
3. Select **Compatible Mode** and click **Login to Supabase**
4. Click **Auto-Setup Schema** to create required tables and functions

> **Note:** Schema setup is handled entirely by the Main App.

## Quick Start

```python
import asyncio
from realtimex_sdk import RealtimeXSDK, SupabaseConfig, RealtimeXConfig

async def main():
    # Initialize SDK
    sdk = RealtimeXSDK(
        supabase=SupabaseConfig(
            url="https://your-project.supabase.co",
            anon_key="your-anon-key"
        ),
        realtimex=RealtimeXConfig(
            url="http://localhost:3001",
            app_name="My Local App"
        )
    )
    
    # Insert activity
    activity = await sdk.activities.insert({
        "type": "new_lead",
        "email": "user@example.com"
    })
    
    # Trigger agent (auto-run)
    result = await sdk.webhook.trigger_agent(
        raw_data=activity,
        auto_run=True,
        agent_name="lead-processor",
        workspace_slug="sales"
    )
    print(f"Task created: {result['task_uuid']}")
    
    # Or create calendar event for manual review
    result = await sdk.webhook.trigger_agent(
        raw_data=activity,
        auto_run=False
    )

asyncio.run(main())
```

## Environment Variables

When your app is started by the Main App, these are auto-set:

| Variable | Description |
|----------|-------------|
| `RTX_APP_ID` | Your app's unique ID |
| `RTX_APP_NAME` | Your app's display name |

## API Reference

See the main [TypeScript README](../typescript/README.md) for full API documentation.
