@icflorescu2
Founder & CTO, Independent
21m ago · New project · Agents · Bucharest

Shipped: tRPC-SvelteKit: end-to-end typesafe APIs for SvelteKit

In February 2022, SvelteKit was young and tRPC was quickly becoming the way to share types between server and client in TypeScript apps, but there was no clean way to use the two together. I wrote tRPC-SvelteKit to fill that gap, and its tagline has stayed the same since: move fast and break nothing.

The idea is simple. You define your tRPC router on the server, add a single handle hook, and call your procedures from your pages with full type safety from the database to the UI. It works with every SvelteKit adapter: Node, Bun, Vercel, Netlify, Cloudflare and more. Procedures can set cookies and headers, responses can stream, subscriptions run over server-sent events, and there's experimental WebSocket support. Since today's 4.1 release, it also generates typed TanStack Svelte Query options.

I've kept it current for almost five years: three major versions of tRPC (v9 to v11) and three of SvelteKit, with 119 releases, 20 contributors and an upgrade guide for every breaking change. It has a dedicated docs site, which now publishes llms.txt so AI coding assistants can read the docs too.

SvelteKit developers rely on it for production APIs, and today it gets over 95,000 npm downloads a month, about three times what it got at the start of 2026.

tRPC-SvelteKit: end-to-end typesafe APIs for SvelteKit logotRPC-SvelteKit: end-to-end typesafe APIs for SvelteKit@icflorescu/trpc-sveltekit · icflorescu.github.io/trpc-sveltekit

Comments

No comments yet
Start the conversation.
Log in to join the thread.