Overview
The Wacht TypeScript SDK provides a comprehensive, type-safe client for all Wacht platform APIs. It is designed for both frontend and backend applications, offering excellent developer experience and flexibility. Additionally, it provides framework-specific authentication and authorization middlewares for popular environments like Node.js (Express-style) and Hono.Key Features
Complete API Coverage
- All Backend Endpoints - Full coverage of Wacht platform APIs
- Type-Safe Models - Strongly typed request/response structures
- Asynchronous Operations - Modern asynchronous patterns with Promises
- Axios-based HTTP Client - Robust and flexible HTTP client
Authentication & Authorization
- JWT Validation - Core JWT token validation logic within the main SDK
- Framework-Specific Middlewares - Dedicated middleware packages for Node.js (Express-style) and Hono for seamless integration.
- Permission System - Fine-grained permission checks at route and handler level (via middlewares)
Developer Experience
- Easy Initialization - Simple SDK initialization
- Environment Configuration - Easy setup via environment variables
- Comprehensive Error Handling - Detailed error types with context
Architecture
The SDK follows a modular architecture with clear separation of concerns:Use Cases
Frontend Applications
Build secure frontend applications that interact with the Wacht platform:- User authentication and session management
- Accessing user-specific data
- Integrating with Wacht APIs for various features
Backend Services
Build secure backend services that interact with the Wacht platform:- User management systems
- Organization and workspace administration
- AI agent orchestration
- Analytics and reporting services
API Gateways
Create API gateways with built-in authentication:- Validate JWT tokens from Wacht
- Enforce permissions at the gateway level
- Route requests based on user context
- Multi-tenant request routing
Microservices
Build microservices that integrate with Wacht:- Service-to-service authentication
- Permission-based access control
- Async task processing
- Event-driven architectures
Getting Started
The SDK is designed to get you up and running quickly:- Install the
wacht-tspackage and the relevant middleware package (e.g.,wacht-middleware-nodeorwacht-middleware-hono). - Set environment variables for API key and host.
- Initialize the SDK in your application.
- Start making API calls or integrate the authentication/authorization middlewares.
