SDKs
Hanzo ZT SDK documentation for Rust, Go, TypeScript, Python, C++, and C. Consistent zero-trust networking across six languages.
SDK Reference
Hanzo ZT provides SDKs for six programming languages. All follow the same pattern: resolve Hanzo IAM credentials, authenticate with the ZT controller, check billing, and dial or bind services through the ZT fabric.
Implementation Status
| Language | Package | Repository | Tests | Status |
|---|---|---|---|---|
| Rust | hanzo-zt | hanzoai/dev | 9 pass | Production |
| Go | github.com/hanzozt/sdk-golang | hanzozt/sdk-golang | 5 pass | Production |
| TypeScript | @hanzo/zt | hanzozt/zt-sdk-nodejs | Complete | Production |
| Python | hanzo-zt | hanzozt/zt-sdk-py | 11 pass | Production |
| C++ | hanzo-zt (CMake) | hanzozt/zt-sdk-cpp | Builds clean | Beta |
| C | libzt_zap | hanzozt/zt-sdk-c | Syntax pass | Beta |
SDK Documentation
Rust
Primary SDK. ZtContext, ConfigBuilder, ZtTransport, and ZAP integration.
Go
ZAP transport with 4-byte framing, JwtCredentials, and BillingGuard.
TypeScript
EventEmitter-based ZtTransport, async auth, and BillingGuard class.
Python
Async transport with httpx, asyncio-native auth, and billing.
C++
RAII classes, Cap'n Proto ZAP framing, and CMake integration.
C
ZAP framing helpers, libcurl-based auth, and minimal API surface.
Common API Surface
All SDKs expose the same core abstractions:
| Concept | Description |
|---|---|
| Context | Main entry point. Manages auth, service discovery, and connections. |
| Config / ConfigBuilder | Configuration with controller URL, credentials, billing toggle, timeouts. |
| Credentials | Trait/interface for auth. Implementations: HanzoJwtCredentials, ApiKeyCredentials. |
| Connection | Bidirectional data channel through the ZT fabric. Supports send/recv. |
| Listener | Accepts incoming connections on a bound service. |
| BillingGuard | Checks balance before dial, records usage after session. |
| Transport | ZAP transport implementation with zt:// URL scheme. |
Choosing an SDK
- Rust: Best for performance-critical applications, CLI tools, and when you need the full ZAP transport integration. The Rust SDK is the reference implementation.
- Go: Best for backend services and microservices that need zero-trust networking with minimal dependencies.
- TypeScript: Best for Node.js services, serverless functions, and full-stack applications.
- Python: Best for ML pipelines, data processing, and scripting where async I/O is needed.
- C++: Best for native applications that need RAII resource management and Cap'n Proto integration.
- C: Best for embedding in existing C codebases or systems with minimal runtime requirements.
Next Steps
Pick your language and dive in: