[{"data":1,"prerenderedAt":585},["ShallowReactive",2],{"page:\u002Fextensions\u002Fkubb-labs\u002Fplugin-client\u002Foptions":3},{"id":4,"frontmatter":5,"title":6,"heading":6,"body":7,"path":584,"source":4},"extensions\u002Fkubb-labs\u002Fplugin-client\u002Foptions.md",{},"Options",{"type":8,"value":9,"toc":572},"minimark",[10,25,30,251,255,259,262,292,350,379,396,399,417,454,459,461,479,516,543,555],[11,12,13,14,18,19,24],"p",{},"Pass these options to ",[15,16,17],"code",{},"pluginClient()",". Shared options link to ",[20,21,23],"a",{"href":22},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options","Shared plugin options",".",[26,27,29],"h2",{"id":28},"options-overview","Options overview",[31,32,33,49],"table",{},[34,35,36],"thead",{},[37,38,39,43,46],"tr",{},[40,41,42],"th",{},"Option",[40,44,45],{},"Purpose",[40,47,48],{},"Default",[50,51,52,69,103,125,147,165,180,198,215,233],"tbody",{},[37,53,54,63,66],{},[55,56,57],"td",{},[20,58,60],{"href":59},"#importpath",[15,61,62],{},"importPath",[55,64,65],{},"Import specifier of your client module.",[55,67,68],{},"Required",[37,70,71,79,98],{},[55,72,73],{},[20,74,76],{"href":75},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#output",[15,77,78],{},"output",[55,80,81,82,85,86,85,89,85,92,85,95,24],{},"Where files are written: ",[15,83,84],{},"path",", ",[15,87,88],{},"mode",[15,90,91],{},"barrel",[15,93,94],{},"banner",[15,96,97],{},"footer",[55,99,100],{},[15,101,102],{},"{ path: 'clients', barrel: { type: 'named' } }",[37,104,105,113,122],{},[55,106,107],{},[20,108,110],{"href":109},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#group",[15,111,112],{},"group",[55,114,115,116,85,119,24],{},"Split output by tag or path: ",[15,117,118],{},"type",[15,120,121],{},"name",[55,123,124],{},"None",[37,126,127,135,142],{},[55,128,129],{},[20,130,132],{"href":131},"#throwonerrordefault",[15,133,134],{},"throwOnErrorDefault",[55,136,137,138,141],{},"Default ",[15,139,140],{},"throwOnError"," value passed to your client.",[55,143,144],{},[15,145,146],{},"true",[37,148,149,157,160],{},[55,150,151],{},[20,152,154],{"href":153},"#validator",[15,155,156],{},"validator",[55,158,159],{},"Pass Zod schemas to your client.",[55,161,162],{},[15,163,164],{},"false",[37,166,167,175,178],{},[55,168,169],{},[20,170,172],{"href":171},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#include",[15,173,174],{},"include",[55,176,177],{},"Keep only operations that match.",[55,179,124],{},[37,181,182,190,193],{},[55,183,184],{},[20,185,187],{"href":186},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#exclude",[15,188,189],{},"exclude",[55,191,192],{},"Skip operations that match.",[55,194,195],{},[15,196,197],{},"[]",[37,199,200,208,211],{},[55,201,202],{},[20,203,205],{"href":204},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#override",[15,206,207],{},"override",[55,209,210],{},"Apply different options per pattern.",[55,212,213],{},[15,214,197],{},[37,216,217,225,228],{},[55,218,219],{},[20,220,222],{"href":221},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#resolver",[15,223,224],{},"resolver",[55,226,227],{},"Customize generated names and file paths.",[55,229,230],{},[15,231,232],{},"resolverClient",[37,234,235,243,246],{},[55,236,237],{},[20,238,240],{"href":239},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#macros",[15,241,242],{},"macros",[55,244,245],{},"Rewrite AST nodes before printing.",[55,247,248,250],{},[15,249,197],{},", run after the built-in client macros",[26,252,254],{"id":253},"option-details","Option details",[256,257,62],"h3",{"id":258},"importpath",[11,260,261],{},"Import specifier of your client module. The plugin writes it into every generated import exactly as given, so it must resolve from the generated file. Use a relative path, a package name, or an alias.",[31,263,264,272],{},[34,265,266],{},[37,267,268,270],{},[40,269],{},[40,271],{},[50,273,274,284],{},[37,275,276,279],{},[55,277,278],{},"Type",[55,280,281],{},[15,282,283],{},"string",[37,285,286,288],{},[55,287,68],{},[55,289,290],{},[15,291,146],{},[293,294,298],"pre",{"language":295,"code":296,"class":297},"typescript","pluginClient({ importPath: '..\u002F..\u002F..\u002Fclient' }) \u002F\u002F relative to src\u002Fgen\u002Fclients\u002F\u003Ctag>\u002F\npluginClient({ importPath: '@my-org\u002Fapi-client' }) \u002F\u002F a package","highlights",[15,299,301,331,332],{"class":300},"language-typescript",[302,303,306,310,314,316,320,324,327],"span",{"class":304,"style":305},"line","display: inline",[302,307,309],{"style":308},"color:#6f42c1;--hls-dark:#b392f0","pluginClient",[302,311,313],{"style":312},"color:#005cc5;--hls-dark:#79b8ff","({ ",[302,315,62],{"style":312},[302,317,319],{"style":318},"color:#d73a49;--hls-dark:#f97583",": ",[302,321,323],{"style":322},"color:#032f62;--hls-dark:#9ecbff","'..\u002F..\u002F..\u002Fclient' ",[302,325,326],{"style":312},"}) ",[302,328,330],{"style":329},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F relative to src\u002Fgen\u002Fclients\u002F\u003Ctag>\u002F","\n",[302,333,334,336,338,340,342,345,347],{"class":304,"style":305},[302,335,309],{"style":308},[302,337,313],{"style":312},[302,339,62],{"style":312},[302,341,319],{"style":318},[302,343,344],{"style":322},"'@my-org\u002Fapi-client' ",[302,346,326],{"style":312},[302,348,349],{"style":329},"\u002F\u002F a package",[11,351,352,353,356,357,360,361,364,365,368,369,372,373,375,376,24],{},"With ",[15,354,355],{},"group: { type: 'tag' }"," and ",[15,358,359],{},"output.path: 'clients'",", a generated file sits in ",[15,362,363],{},"src\u002Fgen\u002Fclients\u002F\u003Ctag>\u002F",", so ",[15,366,367],{},"..\u002F..\u002F..\u002Fclient"," points at ",[15,370,371],{},"src\u002Fclient.ts",". Without ",[15,374,112],{}," it is ",[15,377,378],{},"..\u002F..\u002Fclient",[11,380,381,382,385,386,356,388,391,392,24],{},"The module must export ",[15,383,384],{},"client",", plus the ",[15,387,6],{},[15,389,390],{},"RequestResult"," types. See ",[20,393,395],{"href":394},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-client\u002Fguides\u002Fwrite-your-client","write your client",[256,397,134],{"id":398},"throwonerrordefault",[11,400,401,402,404,405,407,408,411,412,414,415,24],{},"Default for the ",[15,403,140],{}," field that every generated function passes to your client. A call that sets ",[15,406,140],{}," itself wins. Your client decides what the flag does: the ",[20,409,410],{"href":394},"example client"," throws on a non-2xx status when it is ",[15,413,146],{}," and returns the error as a value when it is ",[15,416,164],{},[31,418,419,427],{},[34,420,421],{},[37,422,423,425],{},[40,424],{},[40,426],{},[50,428,429,438,446],{},[37,430,431,433],{},[55,432,278],{},[55,434,435],{},[15,436,437],{},"boolean",[37,439,440,442],{},[55,441,68],{},[55,443,444],{},[15,445,164],{},[37,447,448,450],{},[55,449,48],{},[55,451,452],{},[15,453,146],{},[11,455,456,457,24],{},"The setting applies to the whole plugin, so you cannot set it in ",[15,458,207],{},[256,460,156],{"id":156},[11,462,463,464,467,468,471,472,474,475,24],{},"Passes Zod schemas from ",[15,465,466],{},"@kubb\u002Fplugin-zod"," to your client on ",[15,469,470],{},"config.validator",". The plugin does not run the schemas. Your client reads ",[15,473,470],{}," and runs them. See ",[20,476,478],{"href":477},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-client\u002Fguides\u002Fvalidate-requests-and-responses","validate requests and responses",[31,480,481,489],{},[34,482,483],{},[37,484,485,487],{},[40,486],{},[40,488],{},[50,490,491,500,508],{},[37,492,493,495],{},[55,494,278],{},[55,496,497],{},[15,498,499],{},"false | 'zod' | { request?: 'zod'; params?: 'zod'; response?: 'zod' }",[37,501,502,504],{},[55,503,68],{},[55,505,506],{},[15,507,164],{},[37,509,510,512],{},[55,511,48],{},[55,513,514],{},[15,515,164],{},[517,518,519,523,527],"field-group",{},[520,521,522],"field",{"name":164},"Default value. Passes nothing.",[520,524,526],{"name":525},"'zod'","Passes the response and error schemas.",[520,528,530,531,534,535,538,539,542],{"name":529},"{ request?: 'zod', params?: 'zod', response?: 'zod' }","Opts in per direction. ",[15,532,533],{},"request"," passes the request body schema, ",[15,536,537],{},"params"," the path, query, and header params schemas, and ",[15,540,541],{},"response"," the response and error schemas.",[544,545,547,548,551,552,554],"blockquote",{"as":546},"important","Add ",[15,549,550],{},"pluginZod()"," to the plugins list when ",[15,553,156],{}," is set. Generation stops with an error if it is missing.",[11,556,352,557,560,561,564,565,569,570,24],{},[15,558,559],{},"params: 'zod'",", generated calls also import ",[15,562,563],{},"toHeadersStandardSchema"," from your ",[20,566,567],{"href":59},[15,568,62],{}," module, so that module must export it. See ",[20,571,478],{"href":477},{"title":573,"searchDepth":574,"depth":574,"links":575},"",5,[576,578],{"id":28,"depth":577,"text":29},2,{"id":253,"depth":577,"text":254,"children":579},[580,582,583],{"id":258,"depth":581,"text":62},3,{"id":398,"depth":581,"text":134},{"id":156,"depth":581,"text":156},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-client\u002Foptions",1793747911768]