[{"data":1,"prerenderedAt":500},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fintroduction":3},{"id":4,"title":5,"body":6,"description":481,"extension":482,"frontmatter":483,"heading":5,"meta":491,"navigation":493,"order":487,"path":494,"seo":495,"sitemap":496,"source":497,"stem":498,"__hash__":499},"docs\u002Fdocs\u002F5.x\u002Fintroduction.md","Introduction to Kubb: turn your API spec into code",{"type":7,"value":8,"toc":472},"minimark",[9,13,27,32,117,121,124,284,287,295,299,451,455],[10,11,12],"p",{},"Kubb generates code from API specifications: TypeScript types, API clients, query hooks, validators, and mocks. Regenerate when your specification changes to keep these files in sync with your API, then import them in your application.",[10,14,15,16,20,21,26],{},"Choose the outputs you need with plugins in one ",[17,18,19],"code",{},"kubb.config.ts"," file. Generated files belong to your project. The default ",[22,23,25],"a",{"href":24},"\u002Fextensions\u002Fkubb-labs\u002Fadapter-oas","OpenAPI adapter"," supports OpenAPI 2.0, 3.0, and 3.1.",[28,29,31],"h2",{"id":30},"features","Features",[33,34,35,69,97,100],"ul",{},[36,37,38,39,43,44,48,49,53,54,58,59,63,64,68],"li",{},"Generate ",[22,40,42],{"href":41},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-ts","TypeScript types",", typed ",[22,45,47],{"href":46},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios","Axios"," or ",[22,50,52],{"href":51},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch","Fetch"," clients, ",[22,55,57],{"href":56},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-react-query","React Query",", ",[22,60,62],{"href":61},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-vue-query","Vue Query",", and ",[22,65,67],{"href":66},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-swr","SWR"," hooks.",[36,70,71,72,76,77,81,82,86,87,91,92,96],{},"Validate data with ",[22,73,75],{"href":74},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-zod","Zod",", create ",[22,78,80],{"href":79},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-faker","Faker"," data and ",[22,83,85],{"href":84},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-msw","MSW"," handlers, generate ",[22,88,90],{"href":89},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-cypress","Cypress"," tests, or expose your API through a generated ",[22,93,95],{"href":94},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-mcp","MCP server",".",[36,98,99],{},"Customize the pipeline with adapters, plugins, parsers, macros, and resolvers, or write output to disk, memory, or a custom storage backend.",[36,101,102,103,107,108,112,113,96],{},"Run generation with ",[22,104,106],{"href":105},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Foverview#build-tools","Vite and webpack",", other bundlers, or in CI. Connect AI tools through ",[22,109,111],{"href":110},"\u002Fdocs\u002F5.x\u002Fai\u002Fmcp","MCP"," or use the ",[22,114,116],{"href":115},"\u002Fdocs\u002F5.x\u002Fai\u002Fclaude","Claude Code integration",[28,118,120],{"id":119},"see-it-work","See it work",[10,122,123],{},"The animation below follows a spec through Kubb's generation pipeline. The adapter turns schemas and operations into AST nodes, then plugins generate files from those nodes.",[125,126,130],"pre",{"language":127,"filename":19,"code":128,"class":129},"typescript","import { defineConfig } from 'kubb\u002Fconfig'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { pluginZod } from '@kubb\u002Fplugin-zod'\n\nexport default defineConfig({\n  input: '.\u002FpetStore.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen' },\n  plugins: [pluginTs(), pluginZod()],\n})","highlights",[17,131,133,160,161,160,177,160,193,160,195,160,210,160,227,160,251,160,279],{"class":132},"language-typescript",[134,135,138,142,146,150,153,156],"span",{"class":136,"style":137},"line","display: inline",[134,139,141],{"style":140},"color:#d73a49;--hls-dark:#f97583","import ",[134,143,145],{"style":144},"color:#005cc5;--hls-dark:#79b8ff","{ ",[134,147,149],{"style":148},"color:#24292e;--hls-dark:#e1e4e8","defineConfig ",[134,151,152],{"style":144},"} ",[134,154,155],{"style":140},"from ",[134,157,159],{"style":158},"color:#032f62;--hls-dark:#9ecbff","'kubb\u002Fconfig'","\n",[134,162,163,165,167,170,172,174],{"class":136,"style":137},[134,164,141],{"style":140},[134,166,145],{"style":144},[134,168,169],{"style":148},"pluginTs ",[134,171,152],{"style":144},[134,173,155],{"style":140},[134,175,176],{"style":158},"'@kubb\u002Fplugin-ts'",[134,178,179,181,183,186,188,190],{"class":136,"style":137},[134,180,141],{"style":140},[134,182,145],{"style":144},[134,184,185],{"style":148},"pluginZod ",[134,187,152],{"style":144},[134,189,155],{"style":140},[134,191,192],{"style":158},"'@kubb\u002Fplugin-zod'",[134,194],{"class":136,"style":137},[134,196,197,200,203,207],{"class":136,"style":137},[134,198,199],{"style":140},"export ",[134,201,202],{"style":140},"default ",[134,204,206],{"style":205},"color:#6f42c1;--hls-dark:#b392f0","defineConfig",[134,208,209],{"style":144},"({",[134,211,212,215,218,221,224],{"class":136,"style":137},[134,213,214],{"style":144},"  ",[134,216,217],{"style":144},"input",[134,219,220],{"style":140},": ",[134,222,223],{"style":158},"'.\u002FpetStore.yaml'",[134,225,226],{"style":140},",",[134,228,229,231,234,236,238,241,243,246,249],{"class":136,"style":137},[134,230,214],{"style":140},[134,232,233],{"style":144},"output",[134,235,220],{"style":140},[134,237,145],{"style":144},[134,239,240],{"style":144},"path",[134,242,220],{"style":140},[134,244,245],{"style":158},"'.\u002Fsrc\u002Fgen' ",[134,247,248],{"style":144},"}",[134,250,226],{"style":140},[134,252,253,255,258,260,263,266,269,271,274,277],{"class":136,"style":137},[134,254,214],{"style":140},[134,256,257],{"style":144},"plugins",[134,259,220],{"style":140},[134,261,262],{"style":144},"[",[134,264,265],{"style":205},"pluginTs",[134,267,268],{"style":144},"()",[134,270,58],{"style":140},[134,272,273],{"style":205},"pluginZod",[134,275,276],{"style":144},"()]",[134,278,226],{"style":140},[134,280,281],{"class":136,"style":137},[134,282,283],{"style":144},"})",[285,286],"spec-journey",{},[10,288,289,290,294],{},"See the ",[22,291,293],{"href":292},"\u002Fdocs\u002F5.x\u002Fexplanation\u002Farchitecture","architecture guide"," for details about each stage.",[28,296,298],{"id":297},"start-here","Start here",[300,301,302,315],"table",{},[303,304,305],"thead",{},[306,307,308,312],"tr",{},[309,310,311],"th",{},"You want to",[309,313,314],{},"Read",[316,317,318,330,340,351,370,385,400,411,430,440],"tbody",{},[306,319,320,324],{},[321,322,323],"td",{},"Install Kubb in a project",[321,325,326],{},[22,327,329],{"href":328},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Finstallation","Installation",[306,331,332,335],{},[321,333,334],{},"Generate your first client",[321,336,337],{},[22,338,334],{"href":339},"\u002Fdocs\u002F5.x\u002Ftutorials\u002Fquickstart",[306,341,342,345],{},[321,343,344],{},"Configure a stack or workflow",[321,346,347],{},[22,348,350],{"href":349},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Frecipes","Configure generation",[306,352,353,356],{},[321,354,355],{},"Rename files or customize generated code",[321,357,358,58,362,63,366],{},[22,359,361],{"href":360},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fresolvers","Resolvers",[22,363,365],{"href":364},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fmacros","macros",[22,367,369],{"href":368},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fprinters","printers",[306,371,372,375],{},[321,373,374],{},"Run generation during a build or in CI",[321,376,377,380,381],{},[22,378,379],{"href":105},"Build tools"," and ",[22,382,384],{"href":383},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fci","CI",[306,386,387,390],{},[321,388,389],{},"Use Kubb with a browser or AI assistant",[321,391,392,380,396],{},[22,393,395],{"href":394},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fstudio","Studio",[22,397,399],{"href":398},"\u002Fdocs\u002F5.x\u002Fai","AI assistants",[306,401,402,405],{},[321,403,404],{},"Build a plugin",[321,406,407],{},[22,408,410],{"href":409},"\u002Fdocs\u002F5.x\u002Ftutorials\u002Fcreating-plugins","Plugin tutorial",[306,412,413,416],{},[321,414,415],{},"Look up an option or API",[321,417,418,58,422,63,426],{},[22,419,421],{"href":420},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration","Configuration",[22,423,425],{"href":424},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002F","commands",[22,427,429],{"href":428},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit","Kit API",[306,431,432,435],{},[321,433,434],{},"Understand the pipeline",[321,436,437],{},[22,438,439],{"href":292},"Architecture",[306,441,442,445],{},[321,443,444],{},"Upgrade from v4",[321,446,447],{},[22,448,450],{"href":449},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fmigration","Migration guide",[28,452,454],{"id":453},"community","Community",[10,456,457,458,462,463,467,468,96],{},"Kubb is free and open source under the MIT license. Get help on ",[22,459,461],{"href":460},"https:\u002F\u002Fdiscord.gg\u002FshfBFeczrm","Discord",", report an issue on ",[22,464,466],{"href":465},"https:\u002F\u002Fgithub.com\u002Fkubb-labs\u002Fkubb\u002Fissues","GitHub",", or read ",[22,469,471],{"href":470},"\u002Fdocs\u002F5.x\u002Fcommunity\u002Fcontributing","Contributing",{"title":473,"searchDepth":474,"depth":474,"links":475},"",5,[476,478,479,480],{"id":30,"depth":477,"text":31},2,{"id":119,"depth":477,"text":120},{"id":297,"depth":477,"text":298},{"id":453,"depth":477,"text":454},"Kubb generates TypeScript types, Axios and Fetch clients, TanStack Query hooks, Zod schemas, and MSW mocks from your API spec. Regenerate to keep them in sync.","md",{"layout":484,"title":5,"description":481,"outline":485,"order":487,"navigation":488},"doc",[477,486],3,0,{"title":489,"icon":490},"Introduction","i-iconoir-info-circle",{"layout":484,"outline":492},[477,486],{"title":489,"icon":490},"\u002Fdocs\u002F5.x\u002Fintroduction",{"title":5,"description":481},{"loc":494},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fintroduction.md","docs\u002F5.x\u002Fintroduction","1cr6J1mr3LI6ISLUihvWcYWoynMd0w9hX_xtBTUVLCc",1792931639001]