typescript api client code generation from openapi specifications
Automatically generates type-safe TypeScript client code from Humanitec's OpenAPI specifications, producing fully-typed request/response interfaces, method signatures, and error handling boilerplate. The generator introspects the OpenAPI schema to emit strongly-typed classes and interfaces that map directly to API endpoints, eliminating manual client implementation and keeping generated code synchronized with API changes.
Unique: Purpose-built code generator specifically for Humanitec's API schema, ensuring generated clients are always aligned with the platform's infrastructure automation capabilities and authentication patterns
vs alternatives: More specialized than generic OpenAPI generators (like OpenAPI Generator or Swagger Codegen) because it understands Humanitec-specific patterns and produces idiomatic TypeScript with zero configuration
strongly-typed api method bindings with request/response validation
Provides auto-generated TypeScript method signatures that enforce type safety at compile-time for all Humanitec API operations, with built-in request validation and response deserialization. Each generated method maps to a specific API endpoint with typed parameters, return types, and error responses, enabling IDE autocomplete and catching type mismatches before runtime.
Unique: Generated bindings are specific to Humanitec's infrastructure API, including domain-specific types for resources like Applications, Environments, Deployments, and Workloads that reflect the platform's mental model
vs alternatives: More type-safe than hand-written fetch/axios wrappers because types are generated from the authoritative API schema and enforced by TypeScript compiler, not runtime libraries
automated client library distribution via npm package registry
Packages the generated TypeScript client as a distributable npm module (@humanitec/autogen) that can be installed as a dependency in other projects, with semantic versioning and automatic updates when the Humanitec API schema changes. The package includes pre-compiled JavaScript, TypeScript source maps, and type definitions, enabling seamless integration into npm-based workflows.
Unique: Automatically published npm package that stays synchronized with Humanitec API changes, eliminating the need for manual client library maintenance or version coordination
vs alternatives: Simpler than maintaining a separate client library repository because the package is auto-generated and published directly from the API schema, reducing maintenance burden compared to hand-maintained SDKs
request/response serialization and deserialization with schema compliance
Automatically handles conversion between JavaScript/TypeScript objects and HTTP request/response payloads, including JSON serialization, header management, and response parsing according to the OpenAPI schema. The generated client transparently converts typed method parameters into HTTP requests and parses responses back into typed objects, handling edge cases like nested objects, arrays, and optional fields.
Unique: Serialization logic is generated from the OpenAPI schema, ensuring it always matches the API's expectations and automatically adapts when the schema changes
vs alternatives: More reliable than manual JSON serialization because it's generated from the authoritative schema and catches type mismatches at compile-time rather than runtime
authentication credential management and request signing
Provides built-in support for Humanitec API authentication, handling credential injection into request headers and managing authentication state across multiple API calls. The generated client accepts authentication credentials (API keys, tokens) and automatically includes them in all outgoing requests without requiring manual header manipulation.
Unique: Authentication is baked into the generated client code, eliminating the need for manual header management and ensuring credentials are consistently applied across all API operations
vs alternatives: Simpler than manually managing authentication headers because the client handles credential injection transparently, reducing the surface area for authentication bugs
error handling and http status code mapping
Automatically maps HTTP error responses to typed error objects that can be caught and handled in application code, with specific error types for different failure scenarios (4xx client errors, 5xx server errors, network failures). The generated client parses error responses according to the OpenAPI schema and throws typed exceptions that include status codes, error messages, and additional context.
Unique: Error types are generated from the OpenAPI schema, ensuring they match the actual error responses from Humanitec API and automatically adapt when error schemas change
vs alternatives: More type-safe than generic HTTP error handling because errors are represented as discriminated unions, enabling exhaustive pattern matching in TypeScript