[{"data":1,"prerenderedAt":620},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fintroduction":3},{"id":4,"title":5,"body":6,"description":600,"extension":601,"frontmatter":602,"heading":610,"meta":611,"navigation":613,"order":606,"path":614,"seo":615,"sitemap":616,"source":617,"stem":618,"__hash__":619},"docs\u002Fdocs\u002F5.x\u002Fintroduction.md","Introduction - OpenAPI to TypeScript code generator",{"type":7,"value":8,"toc":591},"minimark",[9,18,60,65,198,205,209,216,376,384,387,391,569,573],[10,11,12,13,17],"p",{},"Kubb turns an API spec into the code your app uses to call that API: types, clients, query hooks, validators, and mocks. You pick the outputs with plugins in one ",[14,15,16],"code",{},"kubb.config.ts",". When the spec changes, run Kubb again and the code follows.",[10,19,20,21,26,27,31,32,36,37,26,41,45,46,31,50,54,55,59],{},"Generate ",[22,23,25],"a",{"href":24},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-ts","TypeScript types",", ",[22,28,30],{"href":29},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios","Axios"," and ",[22,33,35],{"href":34},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch","Fetch"," clients, ",[22,38,40],{"href":39},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-react-query","TanStack Query hooks",[22,42,44],{"href":43},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-zod","Zod schemas",", and ",[22,47,49],{"href":48},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-faker","Faker",[22,51,53],{"href":52},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-msw","MSW"," mocks from an ",[22,56,58],{"href":57},"\u002Fextensions\u002Fkubb-labs\u002Fadapter-oas","OpenAPI spec"," with Kubb.",[61,62,64],"h2",{"id":63},"what-kubb-generates","What Kubb generates",[66,67,68,81],"table",{},[69,70,71],"thead",{},[72,73,74,78],"tr",{},[75,76,77],"th",{},"Output",[75,79,80],{},"Plugins",[82,83,84,96,113,137,149,172,185],"tbody",{},[72,85,86,89],{},[87,88,25],"td",{},[87,90,91],{},[22,92,93],{"href":24},[14,94,95],{},"plugin-ts",[72,97,98,101],{},[87,99,100],{},"HTTP clients",[87,102,103,26,108],{},[22,104,105],{"href":29},[14,106,107],{},"plugin-axios",[22,109,110],{"href":34},[14,111,112],{},"plugin-fetch",[72,114,115,118],{},[87,116,117],{},"Query hooks",[87,119,120,26,125,26,131],{},[22,121,122],{"href":39},[14,123,124],{},"plugin-react-query",[22,126,128],{"href":127},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-vue-query",[14,129,130],{},"plugin-vue-query",[22,132,134],{"href":133},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-swr",[14,135,136],{},"plugin-swr",[72,138,139,142],{},[87,140,141],{},"Validation schemas",[87,143,144],{},[22,145,146],{"href":43},[14,147,148],{},"plugin-zod",[72,150,151,154],{},[87,152,153],{},"Mock data, request handlers, and tests",[87,155,156,26,161,26,166],{},[22,157,158],{"href":48},[14,159,160],{},"plugin-faker",[22,162,163],{"href":52},[14,164,165],{},"plugin-msw",[22,167,169],{"href":168},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-cypress",[14,170,171],{},"plugin-cypress",[72,173,174,177],{},[87,175,176],{},"An MCP server for your API",[87,178,179],{},[22,180,182],{"href":181},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-mcp",[14,183,184],{},"plugin-mcp",[72,186,187,190],{},[87,188,189],{},"API documentation",[87,191,192],{},[22,193,195],{"href":194},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-redoc",[14,196,197],{},"plugin-redoc",[10,199,200,201,204],{},"The default ",[22,202,203],{"href":57},"OpenAPI adapter"," reads OpenAPI 2.0, 3.0, 3.1, and 3.2.",[61,206,208],{"id":207},"see-it-work","See it work",[10,210,211,212,215],{},"This config generates types and Zod schemas from ",[14,213,214],{},"petStore.yaml",":",[217,218,222],"pre",{"language":219,"filename":16,"code":220,"class":221},"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",[14,223,225,252,253,252,269,252,285,252,287,252,302,252,319,252,343,252,371],{"class":224},"language-typescript",[226,227,230,234,238,242,245,248],"span",{"class":228,"style":229},"line","display: inline",[226,231,233],{"style":232},"color:#d73a49;--hls-dark:#f97583","import ",[226,235,237],{"style":236},"color:#005cc5;--hls-dark:#79b8ff","{ ",[226,239,241],{"style":240},"color:#24292e;--hls-dark:#e1e4e8","defineConfig ",[226,243,244],{"style":236},"} ",[226,246,247],{"style":232},"from ",[226,249,251],{"style":250},"color:#032f62;--hls-dark:#9ecbff","'kubb\u002Fconfig'","\n",[226,254,255,257,259,262,264,266],{"class":228,"style":229},[226,256,233],{"style":232},[226,258,237],{"style":236},[226,260,261],{"style":240},"pluginTs ",[226,263,244],{"style":236},[226,265,247],{"style":232},[226,267,268],{"style":250},"'@kubb\u002Fplugin-ts'",[226,270,271,273,275,278,280,282],{"class":228,"style":229},[226,272,233],{"style":232},[226,274,237],{"style":236},[226,276,277],{"style":240},"pluginZod ",[226,279,244],{"style":236},[226,281,247],{"style":232},[226,283,284],{"style":250},"'@kubb\u002Fplugin-zod'",[226,286],{"class":228,"style":229},[226,288,289,292,295,299],{"class":228,"style":229},[226,290,291],{"style":232},"export ",[226,293,294],{"style":232},"default ",[226,296,298],{"style":297},"color:#6f42c1;--hls-dark:#b392f0","defineConfig",[226,300,301],{"style":236},"({",[226,303,304,307,310,313,316],{"class":228,"style":229},[226,305,306],{"style":236},"  ",[226,308,309],{"style":236},"input",[226,311,312],{"style":232},": ",[226,314,315],{"style":250},"'.\u002FpetStore.yaml'",[226,317,318],{"style":232},",",[226,320,321,323,326,328,330,333,335,338,341],{"class":228,"style":229},[226,322,306],{"style":232},[226,324,325],{"style":236},"output",[226,327,312],{"style":232},[226,329,237],{"style":236},[226,331,332],{"style":236},"path",[226,334,312],{"style":232},[226,336,337],{"style":250},"'.\u002Fsrc\u002Fgen' ",[226,339,340],{"style":236},"}",[226,342,318],{"style":232},[226,344,345,347,350,352,355,358,361,363,366,369],{"class":228,"style":229},[226,346,306],{"style":232},[226,348,349],{"style":236},"plugins",[226,351,312],{"style":232},[226,353,354],{"style":236},"[",[226,356,357],{"style":297},"pluginTs",[226,359,360],{"style":236},"()",[226,362,26],{"style":232},[226,364,365],{"style":297},"pluginZod",[226,367,368],{"style":236},"()]",[226,370,318],{"style":232},[226,372,373],{"class":228,"style":229},[226,374,375],{"style":236},"})",[10,377,378,379,383],{},"The adapter turns the spec into AST nodes, and each plugin generates files from those nodes. ",[22,380,382],{"href":381},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Farchitecture","Architecture"," explains each stage.",[385,386],"spec-journey",{},[61,388,390],{"id":389},"start-here","Start here",[66,392,393,403],{},[69,394,395],{},[72,396,397,400],{},[75,398,399],{},"You want to",[75,401,402],{},"Read",[82,404,405,416,427,438,457,472,487,498,517,526,537,558],{},[72,406,407,410],{},[87,408,409],{},"Learn by generating a client from a sample spec",[87,411,412],{},[22,413,415],{"href":414},"\u002Fdocs\u002F5.x\u002Ftutorials\u002Fquickstart","Generate your first client",[72,417,418,421],{},[87,419,420],{},"Add Kubb to your project",[87,422,423],{},[22,424,426],{"href":425},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Finstallation","Installation",[72,428,429,432],{},[87,430,431],{},"Set up a stack, such as React Query with Zod",[87,433,434],{},[22,435,437],{"href":436},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Frecipes","Configure generation",[72,439,440,443],{},[87,441,442],{},"Rename files or change generated code",[87,444,445,26,449,45,453],{},[22,446,448],{"href":447},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize#resolvers","Resolvers",[22,450,452],{"href":451},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize#macros","macros",[22,454,456],{"href":455},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fcustomize#printers","printers",[72,458,459,462],{},[87,460,461],{},"Generate during a build or in CI",[87,463,464,31,468],{},[22,465,467],{"href":466},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools","Build tools",[22,469,471],{"href":470},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fci","CI",[72,473,474,477],{},[87,475,476],{},"Use Kubb from a browser or an AI assistant",[87,478,479,31,483],{},[22,480,482],{"href":481},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fstudio","Studio",[22,484,486],{"href":485},"\u002Fdocs\u002F5.x\u002Fai","AI assistants",[72,488,489,492],{},[87,490,491],{},"Build a plugin",[87,493,494],{},[22,495,497],{"href":496},"\u002Fdocs\u002F5.x\u002Ftutorials\u002Fcreating-plugins","Create a plugin",[72,499,500,503],{},[87,501,502],{},"Look up an option, command, or API",[87,504,505,26,509,45,513],{},[22,506,508],{"href":507},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration","Configuration",[22,510,512],{"href":511},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002F","commands",[22,514,516],{"href":515},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit","Kit API",[72,518,519,522],{},[87,520,521],{},"Understand the pipeline",[87,523,524],{},[22,525,382],{"href":381},[72,527,528,531],{},[87,529,530],{},"Compare Kubb with other generators",[87,532,533],{},[22,534,536],{"href":535},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Fcomparison","Comparison",[72,538,539,542],{},[87,540,541],{},"Switch from another generator",[87,543,544,545,26,549,553,554],{},"Move from ",[22,546,548],{"href":547},"\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval","orval",[22,550,552],{"href":551},"\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-hey-api","HeyAPI",", or ",[22,555,557],{"href":556},"\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-openapi-typescript","openapi-typescript",[72,559,560,563],{},[87,561,562],{},"Upgrade from v4",[87,564,565],{},[22,566,568],{"href":567},"\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-v4","Migration guide",[61,570,572],{"id":571},"community","Community",[10,574,575,576,580,581,585,586,590],{},"Kubb is free and open source under the MIT license. Ask on ",[22,577,579],{"href":578},"https:\u002F\u002Fdiscord.gg\u002FshfBFeczrm","Discord",", report bugs on ",[22,582,584],{"href":583},"https:\u002F\u002Fgithub.com\u002Fkubb-labs\u002Fkubb\u002Fissues","GitHub",", or read the ",[22,587,589],{"href":588},"\u002Fdocs\u002F5.x\u002Fcommunity\u002Ffaq","FAQ",".",{"title":592,"searchDepth":593,"depth":593,"links":594},"",5,[595,597,598,599],{"id":63,"depth":596,"text":64},2,{"id":207,"depth":596,"text":208},{"id":389,"depth":596,"text":390},{"id":571,"depth":596,"text":572},"Generate TypeScript types, Axios and Fetch clients, TanStack Query hooks, Zod schemas, and Faker and MSW mocks from an OpenAPI spec with Kubb.","md",{"layout":603,"title":5,"description":600,"outline":604,"order":606,"navigation":607},"doc",[596,605],3,0,{"title":608,"icon":609},"Introduction","i-iconoir-info-circle","Introduction to Kubb: turn your API spec into code",{"layout":603,"outline":612},[596,605],{"title":608,"icon":609},"\u002Fdocs\u002F5.x\u002Fintroduction",{"title":5,"description":600},{"loc":614},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fintroduction.md","docs\u002F5.x\u002Fintroduction","7V4EHaPjBdmemnzNceTJOZqLiIWFEJWTGL2wmoUNvEE",1795448474589]