{"id":13602169,"url":"https://github.com/flodlc/http-wizard","last_synced_at":"2025-10-04T20:10:50.337Z","repository":{"id":176524216,"uuid":"649102052","full_name":"flodlc/http-wizard","owner":"flodlc","description":"Http-wizard weaves TypeScript magic, offering a type-safe API client and ensuring a delightful end-to-end developer experience.","archived":false,"fork":false,"pushed_at":"2024-03-03T14:01:45.000Z","size":60576,"stargazers_count":65,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-28T00:59:50.932Z","etag":null,"topics":["api","client","fastify","js","json-schema","react-query","tanstack-query","typebox","typescript","zod"],"latest_commit_sha":null,"homepage":"https://http-wizard.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flodlc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-03T19:32:59.000Z","updated_at":"2025-09-12T14:27:13.000Z","dependencies_parsed_at":"2024-09-23T09:10:45.458Z","dependency_job_id":null,"html_url":"https://github.com/flodlc/http-wizard","commit_stats":{"total_commits":147,"total_committers":5,"mean_commits":29.4,"dds":0.653061224489796,"last_synced_commit":"7d18b2b23ee371f3b1d822f276ebdcf2d9e6d47c"},"previous_names":["flodlc/typebox-client","flodlc/http-wizard","flodlc/ts-fastify-client"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/flodlc/http-wizard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flodlc%2Fhttp-wizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flodlc%2Fhttp-wizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flodlc%2Fhttp-wizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flodlc%2Fhttp-wizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flodlc","download_url":"https://codeload.github.com/flodlc/http-wizard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flodlc%2Fhttp-wizard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278366664,"owners_count":25975095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","fastify","js","json-schema","react-query","tanstack-query","typebox","typescript","zod"],"created_at":"2024-08-01T18:01:15.639Z","updated_at":"2025-10-04T20:10:50.322Z","avatar_url":"https://github.com/flodlc.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003ehttp-wizard\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://git.io/typing-svg\"\u003e\u003cimg src=\"https://readme-typing-svg.demolab.com?font=Fira+Code\u0026size=18\u0026duration=2000\u0026pause=2000\u0026center=true\u0026width=540\u0026height=80\u0026lines=Delightful end-to-end experience with Typescript\" alt=\"Typing SVG\" /\u003e\u003c/a\u003e\u003c/p\u003e\n\n### Full documentation website:\n\n[http-wizard.vercel.app](https://http-wizard.vercel.app)\n\n## Introduction\n\nHttp-wizard weaves TypeScript magic, offering a type-safe API client and ensuring a delightful end-to-end developer experience. ✨\n\n#### Here is an example of usage\n\nhttps://github.com/flodlc/http-wizard/assets/3781663/e88fc3f8-4174-4ce0-b0f7-30ab127b4bea\n\n### What it can do:\n\n- 100% type-safe api client with typescript magic (no code generation)\n- Fastify first-class support\n- React-query first-class support\n- Zod and Typebox Type providers\n- Delightful end-to-end developer experience (tRPC-like)\n- Http standards / REST compatibility: you are owner of your routes\n- Type inference utils\n\n---\n\nTable of Contents:\n\n- [Installation](#installation)\n- [Usage](#usage)\n\n---\n\n## Installation\n\nTo get started, install http-wizard using npm or yarn:\n\n```sh\nnpm install @http-wizard/core\n# or\nyarn add @http-wizard/core\n```\n\n## Usage\n\nCurrently http-wizard uses Zod or Typebox for validation.\nHere is an example with Zod.\n\nLet's first create a route on the server:\n\n```typescript title=\"Route creation with Fastify and Zod\"\n// server.ts\nimport { createRoute } from '@http-wizard/core';\nimport { z } from 'zod';\n\nconst User = z.object({\n  id: z.string(),\n  name: z.string(),\n});\n\nexport const getUsers = (fastify: FastifyInstance) =\u003e {\n  return createRoute('/users', {\n    method: 'GET',\n    schema: {\n      response: {\n        200: z.array(User),\n      },\n    },\n  }).handle((props) =\u003e {\n    fastify.route({\n      ...props,\n      handler: (request) =\u003e {\n        const users = await db.getUsers();\n        return users;\n      },\n    });\n  });\n};\n\nconst router = { ...getUsers() };\nexport type Router = typeof router;\n```\n\nNow, let's use the Router type on the client:\n\n```typescript title=\"Client instanciation with axios\"\n// client.ts\nimport { createClient, ZodTypeProvider } from '@http-wizard/core';\nimport axios from 'axios';\n\nimport type { Router } from './server';\n\nconst apiClient = createClient\u003cRouter, ZodTypeProvider\u003e(axios.instance());\nconst users = await apiClient.ref('[GET]/users').query({});\n// users array is safe: { id:string, name:string }[]\n```\n\nEasy, right?\n","funding_links":[],"categories":["Packages","api"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflodlc%2Fhttp-wizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflodlc%2Fhttp-wizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflodlc%2Fhttp-wizard/lists"}