Overview
The Wacht Rust SDK provides a type-safe client for all Wacht platform APIs and authentication middleware for Axum web applications.Features
API Client
- All 72 Backend Endpoints - Full coverage of Wacht platform APIs
- Type-Safe Models - Typed request/response structures
- Async/Await - Async support with Tokio
- Automatic Retries - Built-in retry logic
Authentication Middleware
- JWT Validation - JWT token validation
- Multiple Algorithms - Support for HS256/384/512, RS256/384/512, ES256/384
- Permission System - Permission checks at route and handler level
- Axum Integration - Integration with Axum web framework
Developer Tools
- Global Client - HTTP client with connection pooling
- Environment Configuration - Setup via environment variables
- Error Handling - Detailed error types
- Tracing Support - Observability with tracing crate
Architecture
Use Cases
Backend Services
- User management systems
- Organization and workspace administration
- AI agent orchestration
- Analytics and reporting services
API Gateways
- Validate JWT tokens from Wacht
- Enforce permissions at the gateway level
- Route requests based on user context
- Multi-tenant request routing
Microservices
- Service-to-service authentication
- Permission-based access control
- Async task processing
Comparison with React SDK
While the React SDK focuses on frontend authentication flows and UI components, the Rust SDK provides:| Feature | React SDK | Rust SDK |
|---|---|---|
| Target | Frontend applications | Backend services |
| Authentication | Client-side flows | JWT validation middleware |
| API Access | Limited frontend APIs | All backend APIs |
| Components | UI components | Middleware layers |
| State Management | React hooks | Stateless validation |
| Use Case | User-facing apps | Services & APIs |
Getting Started
The SDK is designed to get you up and running quickly:- Add the dependency to your
Cargo.toml - Set environment variables for API key and host
- Initialize the SDK in your main function
- Start making API calls or add auth middleware
