TapKitClient is your main entry point for interacting with TapKit. It handles authentication, connection management, and provides access to your phones.
Basic Usage
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | None | Your API key. Falls back to TAPKIT_API_KEY env var |
base_url | str | None | https://api.tapkit.ai | API endpoint. Falls back to TAPKIT_BASE_URL env var |
timeout | float | 65.0 | Request timeout in seconds |
Context Manager
Use the client as a context manager for automatic cleanup:System Status
Check the overall system status:Status Fields
| Field | Type | Description |
|---|---|---|
mac_app_running | bool | Whether the Mac companion app is running |
phone_connected | bool | Whether a phone is connected |
phone_name | str | None | Name of the connected phone |
switch_control_enabled | bool | Whether Switch Control is enabled |
screen_locked | bool | Whether the device screen is locked |
streaming | bool | Whether screen streaming is active |
Client-Level Actions
You can execute actions directly on the client when you’ve set a default phone:Error Handling
The SDK raisesTapKitError for API errors: