{"repo":"Bewinxed/svetch","free":true,"listed":false,"github":"https://github.com/Bewinxed/svetch","clone":"git clone https://github.com/Bewinxed/svetch.git","description":"Auto-Generated typesafe client & API docs generator for your Serverless Application (Svelte First)","language":"TypeScript","stars":74,"topics":["codegen","openapi","svelte","sveltekit","swagger"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"🚀 Svetch.ts: Zero-Effort client/types/schema/OpenAPI Schema/Docs generator for your API endpoints Typesafety, Minus the typing 👉 Check it out @ (https://svetch-dev.vercel.app/) Effortlessly generate a typesafe Fetch client for your Svelte/Sveltekit applications, complete with automatic input/output zod validation and autogenerated types & API Docs. What is this? Svetch automatically scans your +server.ts files in /src/routes/api (or whatever directory you specify) and generates a typesafe Fetch client that has intellisense for path, query, body parameters & all the possible responses (and errors) 🧙‍♂️ Automatic Detection - ❓ Query Params = Detected using any declarations of url.searchParams.get - 📂 Path Params = Detected from the file directory - 📦 Payload Definition = inferred from const payload: X = await request.json or as X - 💬 Response Definition = inferred from any return statement with json(X) (sveltekit utility) or new Response(X) - 📛 Error Definitions = inferred from any throw statement with throw error() or throw new Error or return error(HTTP CODE, error message) ⏬ How to run $ npx svetch.ts@latest Make sure you have a path alias for src in your svelte.config.js 🌟 Advantages - 😍 ALMOST no code changes required to your existing API code - 🚀 Almost no learning curve, Augments a regular FETCH client with data and error along with the rest of the fetch client properties, you can use it just like a regular fetch client. - 🔎 Intellisense for your api paths. - ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Bewinxed","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Bewinxed/svetch/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}