Comparisons

How Cleverbrush compares to popular TypeScript frameworks. We aim to be precise — where competitors are ahead, we say so.

Feature matrix

FeatureCleverbrushtRPCts-restHono
API styleREST (contract-first)RPC onlyREST (contract-first)REST (server-first)
Typed clientZero codegen, Proxy-basedYesYeshc helper
Exhaustive handler mappingmapHandlers() compile errorNoYes (Express/Fastify)No
OpenAPI generationFull 3.1 (links, callbacks, webhooks)@trpc/openapi (alpha)@ts-rest/open-api@hono/zod-openapi
Client retry & timeoutBuilt-in with backoff + jitterVia TanStack QueryDIYNo client-side
Client dedup & batchingBoth built-inBatching via httpBatchLinkNoNo
Client cachingBuilt-in TTL cacheVia TanStack QueryNoNo
AuthJWT, cookies, OAuth2, OIDC, RBACContext patternDIYBasic/Bearer/JWT middleware
Dependency injectionSchema-as-key, .NET-styleNoNoNo
WebSocket subscriptionsTyped, bidirectional, reconnectYes, with tracked eventsNoVia WebSocket Helper
Schema-driven forms@cleverbrush/react-formNoNoNo
Multi-runtimeNode.jsNode.js, Bun, Deno, CF WorkersNode.js (adapters)All major runtimes
Schema library@cleverbrush/schema (own)Any (Zod, Valibot, etc.)Zod, Valibot, ArkTypeZod (via @hono/zod-openapi)

vs tRPC

Where Cleverbrush is stronger

  • Standard REST endpoints — tRPC uses RPC semantics exclusively. Cleverbrush produces standard REST endpoints that work with any HTTP client, not just the tRPC client.
  • Client resilience — built-in retry with exponential backoff + jitter, timeout, deduplication, TTL caching, and request batching. tRPC relies on TanStack Query for retry/cache.
  • Integrated auth & DI — JWT, OAuth2, OIDC, policy-based authorization, and schema-driven dependency injection. tRPC uses a manual context pattern.
  • OpenAPI completeness— response links, callbacks, webhooks, response headers, and security schemes. tRPC's OpenAPI support is alpha-stage.
  • Schema-driven forms — generate headless React forms from the same schemas used by the server.

Where tRPC is stronger

  • Community & ecosystem — 36k+ GitHub stars, extensive tutorials, adapter ecosystem, and widespread adoption.
  • Multi-runtime — tRPC works in Cloudflare Workers, Deno, Bun, AWS Lambda, and more. Cleverbrush currently targets Node.js.
  • Any validator — tRPC works with Zod, Valibot, ArkType, Yup, and any Standard Schema validator. Cleverbrush uses its own schema library (which supports Standard Schema and can wrap other validators via extern()).

Code comparison: defining an endpoint

Cleverbrush
// contract.ts — shared between server and client
const api = defineApi({
  users: {
    create: endpoint.post('/api/users')
              .body(CreateUserBody)
              .returns(User)
  }
});

// server.ts — exhaustive handler mapping
mapHandlers(server, api, {
  users: {
    create: async ({ body }) => db.users.insert(body)
  }
});

// client.ts — zero codegen
const client = createClient(api, { baseUrl });
const user = await client.users.create({ body: { name: 'Alice' } });
tRPC
// server.ts — define procedures inline
const appRouter = router({
  createUser: publicProcedure
    .input(z.object({ name: z.string() }))
    .mutation(async ({ input }) => db.users.insert(input))
});
type AppRouter = typeof appRouter;

// client.ts — needs the server type
const trpc = createTRPCClient<AppRouter>({ links: [...] });
const user = await trpc.createUser.mutate({ name: 'Alice' });

vs ts-rest

ts-rest is the closest competitor architecturally — both use contract-first REST with typed clients.

Where Cleverbrush is stronger

  • Client resilience — retry, timeout, deduplication, caching, and batching are all built-in. ts-rest provides a lightweight fetch client with no resilience features.
  • Auth & DI — integrated JWT, OAuth2, OIDC, policy-based authorization, and schema-driven DI. ts-rest has no auth or DI system.
  • WebSocket subscriptions — typed bidirectional channels with automatic reconnection. ts-rest has no WebSocket support.
  • OpenAPI completeness — typed response links, callbacks, webhooks, and response headers. ts-rest generates basic OpenAPI specs.
  • Schema-driven forms & mapping — the schema powers form generation and object mapping with compile-time completeness checking.

Where ts-rest is stronger

  • Server adapter ecosystem — ts-rest works with Express, Fastify, Next.js, and NestJS. Cleverbrush has its own server.
  • Validator agnostic — ts-rest works with Zod, Valibot, and ArkType out of the box.
  • Community — more established with a growing ecosystem and community resources.

vs Hono

Hono is a lightweight, multi-runtime web framework. Different philosophy — Hono is server-first and runtime-flexible; Cleverbrush is schema-first and full-stack.

Where Cleverbrush is stronger

  • Contract-first architecture— shared contract with exhaustive handler mapping. Hono's hc client infers types from typeof app which can cause IDE performance issues in large apps.
  • Client resilience— built-in retry, timeout, deduplication, caching, batching. Hono's hc is a minimal fetch wrapper.
  • Auth & DI — comprehensive auth system with OAuth2, OIDC, and policy-based authorization. Hono has basic auth/JWT middleware but no authorization framework or DI container.
  • Full-stack integration — schemas drive server endpoints, client types, OpenAPI, forms, DI, and object mapping. Hono focuses on the server layer only.

Where Hono is stronger

  • Multi-runtime — runs on Cloudflare Workers, Deno, Bun, AWS Lambda, Fastly, and more. Cleverbrush currently targets Node.js.
  • Middleware ecosystem — 20+ built-in middleware (CORS, ETag, compress, logger, etc.) plus third-party packages.
  • Lightweight & fast — optimized for edge runtimes with minimal overhead.
  • Community — large, active community with extensive tutorials and production usage.

Schema library comparison

@cleverbrush/schema is the foundation. For detailed benchmarks, bundle size comparisons, and feature matrix vs Zod, Valibot, ArkType, and TypeBox, see the dedicated schema site:

Schema Comparison →Interactive Playground →

Where we're honest about gaps

  • Multi-runtime support — currently Node.js only. Cloudflare Workers, Deno, and Bun support is planned.
  • Community size — pre-1.0 vs established ecosystems with thousands of stars and extensive community resources.
  • Server adapter flexibility — Cleverbrush has its own server rather than adapters for Express/Fastify/Next.js.
  • Validator lock-in — built around@cleverbrush/schema. The extern() wrapper allows using Zod/Valibot schemas inside Cleverbrush schemas for incremental adoption.