Services and typed clients
Define an operation once, implement it on the server, and call it through a validated typed client.
Share the contract, not the server
Service separates public contracts from implementations. One contract drives request validation, status-specific responses and typed client calls. Database handles and credentials stay server-only.
Service does not listen on a port. The Elysia adapter hosts it; the native server target owns the listener and shutdown.
import { defineService } from "@smoothie-framework/service";
import { createClient } from "@smoothie-framework/service/client";
import { mountService } from "@smoothie-framework/service-elysia";Build one operation end to end
- Define contracts and handlers for public input, output and request state.
- Run an HTTP service with Elysia and explicit listener ownership.
- Call services from your application without importing server code.
- Query caching with TanStack Query when native cache ownership is useful.
- Streaming, errors and cancellation for long-lived responses and uncertain outcomes.
- Browser-safe contracts and OpenAPI for optional build-time projection and JSON interoperability.