Show HN: KubernetesJS – Fully-Typed, Zero-Dependency Client for Kubernetes
KubernetesJS also uses the Kubernetes Swagger schema, but instead of generating clients at runtime, it generates fully-typed static TypeScript code at build time. That means you get excellent TypeScript support, predictable APIs, and no runtime dependencies. It works in both Node.js and browser environments, and you can install it with npm install kubernetesjs.
By default, the generated client is over 15,000 lines of code—that’s because it’s fully comprehensive, covering the entire Kubernetes API surface with rich TypeScript types. The tradeoff is verbosity, but in exchange you get clarity, safety, and first-class DX. If you prefer something leaner, you can generate a custom client and cherry-pick only the capabilities you want to expose using our schema-sdk module you can see it's use in the KubernetesJS monorepo. This is useful for building a smaller surface area or tailoring the API to a specific use case.
My broader goal is to move past Helm and YAML templating. Just like JSX replaced traditional templating in frontend development, I think Kubernetes needs a shift toward programmatic infrastructure—code that’s more composable, testable, and easier to reason about.
As a bonus, we also publish a React client with hooks powered by TanStack Query. This gives frontend developers a way to build dynamic apps and dashboards directly on top of Kubernetes. You can install that with npm install @kubernetesjs/react.
Still early, but it’s ready to use, and I’d love your feedback :)
Main package: https://www.npmjs.com/package/kubernetesjs React hooks: https://www.npmjs.com/package/@kubernetesjs/react GitHub: https://github.com/hyperweb-io/kubernetesjs
No comments yet