Official SDKs
Tzafon provides official SDKs for Python and TypeScript with identical functionality and APIs.Python SDK
TypeScript SDK
Installation
Environment Variable (Recommended)
Explicit API Key
Basic Usage
Both SDKs follow the same pattern with language-specific conventions.How Actions Work
Actions execute immediately when called. Each method call sends a request to the computer instance.API Levels
The SDK provides two levels of API access:High-Level Wrapper (Recommended for Simple Workflows)
The wrapper provides convenient, language-idiomatic methods for common operations:tab_id or include_context.
Use the wrapper when:
- You’re working with a single tab
- You want clean, readable code
- You don’t need page context or advanced features
Direct API or execute_action/execute (For Advanced Features)
Use execute_action/execute when:- You need multi-tab management (
tab_idparameter) - You want page context (
include_contextparameter) - You’re batching multiple actions together
execute_action()/execute() method:
For multi-tab workflows and page context, see Multi-Tab Management and Page Context.
Feature Parity
Core actions work identically across both SDKs:| Action | Python | TypeScript |
|---|---|---|
| Navigate | navigate(url) | navigate(url) |
| Click | click(x, y) | click(x, y) |
| Type | type(text) | type(text) |
| Screenshot | screenshot() | screenshot() |
| Double Click | double_click(x, y) | doubleClick(x, y) |
| Right Click | right_click(x, y) | rightClick(x, y) |
| Drag | drag(x1, y1, x2, y2) | drag(x1, y1, x2, y2) |
| Hotkey | hotkey(*keys) | hotkey(keys) |
| Scroll | scroll(dx, dy) | scroll(dx, dy) |
| HTML | html() | getHTML() |
| Debug | debug(command) | debug(command) |
| Set Viewport | set_viewport(w, h) | setViewport(w, h) |
| Wait | wait(seconds) | wait(seconds) |
Advanced Features
| Feature | Python | TypeScript |
|---|---|---|
| Batch Actions | execute_batch(actions) | batch(actions) |
| Key Down | execute_action({"type": "key_down", ...}) | execute({ type: 'key_down', ...}) |
| Key Up | execute_action({"type": "key_up", ...}) | execute({ type: 'key_up', ...}) |
| Mouse Down | execute_action({"type": "mouse_down", ...}) | execute({ type: 'mouse_down', ...}) |
| Mouse Up | execute_action({"type": "mouse_up", ...}) | execute({ type: 'mouse_up', ...}) |
| Keep Alive | keep_alive() | keepAlive() |
| Stream Events | stream_events() | streamEvents() |
| Stream Screencast | stream_screencast() | streamScreencast() |
Version Requirements
Python
- Python 3.9+
- pip
TypeScript/Node
- Node.js 20+ (LTS)
- npm/yarn/pnpm