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