[{"data":1,"prerenderedAt":571},["ShallowReactive",2],{"navigation_docs":3,"-guides-bundling":195,"-guides-bundling-surround":566},[4,23,65,87,133,155,173],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":22},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",false,{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":22},"Guides","i-lucide-compass","\u002Fguides","2.guides",[29,33,37,41,45,49,53,57,61],{"title":30,"path":31,"stem":32},"Authenticate","\u002Fguides\u002Fauthentication","2.guides\u002F1.authentication",{"title":34,"path":35,"stem":36},"Work with several forges","\u002Fguides\u002Fmultiple-forges","2.guides\u002F2.multiple-forges",{"title":38,"path":39,"stem":40},"Configure from the environment","\u002Fguides\u002Fenvironment","2.guides\u002F3.environment",{"title":42,"path":43,"stem":44},"Receive webhooks","\u002Fguides\u002Fwebhooks","2.guides\u002F4.webhooks",{"title":46,"path":47,"stem":48},"Check what a forge supports","\u002Fguides\u002Fcapabilities","2.guides\u002F5.capabilities",{"title":50,"path":51,"stem":52},"Handle errors and rate limits","\u002Fguides\u002Ferrors","2.guides\u002F6.errors",{"title":54,"path":55,"stem":56},"Page through results","\u002Fguides\u002Fpagination","2.guides\u002F7.pagination",{"title":58,"path":59,"stem":60},"Browser bundles","\u002Fguides\u002Fbundling","2.guides\u002F8.bundling",{"title":62,"path":63,"stem":64},"Test your code","\u002Fguides\u002Ftesting","2.guides\u002F9.testing",{"title":66,"icon":67,"path":68,"stem":69,"children":70,"page":22},"Concepts","i-lucide-lightbulb","\u002Fconcepts","3.concepts",[71,75,79,83],{"title":72,"path":73,"stem":74},"Data model","\u002Fconcepts\u002Fdata-model","3.concepts\u002F1.data-model",{"title":76,"path":77,"stem":78},"Capabilities","\u002Fconcepts\u002Fcapabilities","3.concepts\u002F2.capabilities",{"title":80,"path":81,"stem":82},"Providers and factories","\u002Fconcepts\u002Fproviders","3.concepts\u002F3.providers",{"title":84,"path":85,"stem":86},"Events","\u002Fconcepts\u002Fevents","3.concepts\u002F4.events",{"title":88,"icon":89,"path":90,"stem":91,"children":92,"page":22},"Providers","i-lucide-server","\u002Fproviders","4.providers",[93,97,101,105,109,113,117,121,125,129],{"title":94,"path":95,"stem":96},"Azure DevOps","\u002Fproviders\u002Fazure-devops","4.providers\u002Fazure-devops",{"title":98,"path":99,"stem":100},"Bitbucket Cloud","\u002Fproviders\u002Fbitbucket","4.providers\u002Fbitbucket",{"title":102,"path":103,"stem":104},"Cursor Origin","\u002Fproviders\u002Fcursor-origin","4.providers\u002Fcursor-origin",{"title":106,"path":107,"stem":108},"Forgejo and Codeberg","\u002Fproviders\u002Fforgejo","4.providers\u002Fforgejo",{"title":110,"path":111,"stem":112},"Gitea","\u002Fproviders\u002Fgitea","4.providers\u002Fgitea",{"title":114,"path":115,"stem":116},"Gitee","\u002Fproviders\u002Fgitee","4.providers\u002Fgitee",{"title":118,"path":119,"stem":120},"GitHub","\u002Fproviders\u002Fgithub","4.providers\u002Fgithub",{"title":122,"path":123,"stem":124},"GitLab","\u002Fproviders\u002Fgitlab","4.providers\u002Fgitlab",{"title":126,"path":127,"stem":128},"pushin.eu","\u002Fproviders\u002Fpushin","4.providers\u002Fpushin",{"title":130,"path":131,"stem":132},"Tangled","\u002Fproviders\u002Ftangled","4.providers\u002Ftangled",{"title":134,"icon":135,"path":136,"stem":137,"children":138,"page":22},"Reference","i-lucide-book-marked","\u002Freference","5.reference",[139,143,147,151],{"title":140,"path":141,"stem":142},"Provider API","\u002Freference\u002Fprovider-api","5.reference\u002F1.provider-api",{"title":144,"path":145,"stem":146},"Capability matrix","\u002Freference\u002Fcapability-matrix","5.reference\u002F2.capability-matrix",{"title":148,"path":149,"stem":150},"Errors","\u002Freference\u002Ferrors","5.reference\u002F3.errors",{"title":152,"path":153,"stem":154},"JSON Schemas","\u002Freference\u002Fjson-schemas","5.reference\u002F5.json-schemas",{"title":156,"icon":157,"path":158,"stem":159,"children":160,"page":22},"Examples","i-lucide-boxes","\u002Fexamples","6.examples",[161,165,169],{"title":162,"path":163,"stem":164},"Inbox CLI","\u002Fexamples\u002Finbox-cli","6.examples\u002F1.inbox-cli",{"title":166,"path":167,"stem":168},"Label bot","\u002Fexamples\u002Flabel-bot","6.examples\u002F2.label-bot",{"title":170,"path":171,"stem":172},"Release digest","\u002Fexamples\u002Frelease-digest","6.examples\u002F3.release-digest",{"title":174,"icon":175,"path":176,"stem":177,"children":178,"page":22},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","7.contributing",[179,183,187,191],{"title":180,"path":181,"stem":182},"Contribution guide","\u002Fcontributing\u002Fguidelines","7.contributing\u002F1.guidelines",{"title":184,"path":185,"stem":186},"Write a provider","\u002Fcontributing\u002Fwrite-a-provider","7.contributing\u002F2.write-a-provider",{"title":188,"path":189,"stem":190},"Record fixtures","\u002Fcontributing\u002Frecord-fixtures","7.contributing\u002F3.record-fixtures",{"title":192,"path":193,"stem":194},"Contributors","\u002Fcontributing\u002Fcontributors","7.contributing\u002F4.contributors",{"id":196,"title":58,"body":197,"description":558,"extension":559,"links":560,"meta":561,"navigation":563,"path":59,"seo":564,"stem":60,"__hash__":565},"docs\u002F2.guides\u002F8.bundling.md",{"type":198,"value":199,"toc":550},"minimark",[200,209,214,217,259,269,273,291,320,327,331,348,351,355,364,377,381,384,463,469,473,489,492,505,512,530,537,546],[201,202,203,204,208],"p",{},"This page explains how to keep ",[205,206,207],"code",{},"forges"," small in a browser bundle and how CI checks the bundle sizes.",[210,211,213],"h2",{"id":212},"import-one-forge","Import one forge",[201,215,216],{},"Each provider has its own subpath export. Import from the subpath to bundle only the forges you use:",[218,219,224],"pre",{"className":220,"code":221,"language":222,"meta":223,"style":223},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { githubLite } from 'forges\u002Fgithub'\n","ts","",[205,225,226],{"__ignoreMap":223},[227,228,231,235,239,243,246,249,252,256],"span",{"class":229,"line":230},"line",1,[227,232,234],{"class":233},"s7zQu","import",[227,236,238],{"class":237},"sMK4o"," {",[227,240,242],{"class":241},"sTEyZ"," githubLite",[227,244,245],{"class":237}," }",[227,247,248],{"class":233}," from",[227,250,251],{"class":237}," '",[227,253,255],{"class":254},"sfazB","forges\u002Fgithub",[227,257,258],{"class":237},"'\n",[201,260,261,262,264,265,268],{},"The root ",[205,263,207],{}," entry re-exports every provider. The package declares ",[205,266,267],{},"sideEffects: false",", so bundlers can tree-shake the root entry, but a subpath import makes the dependency explicit.",[210,270,272],{"id":271},"use-the-lite-factory","Use the Lite factory",[201,274,275,276,279,280,283,284,286,287,290],{},"Every provider except pushin.eu exports two factories, ",[205,277,278],{},"\u003Ckind>()"," and ",[205,281,282],{},"\u003Ckind>Lite()",". Both build the same provider. Only ",[205,285,278],{}," references the webhook handlers. A browser doesn't receive webhook deliveries, so a bundle that imports only ",[205,288,289],{},"githubLite"," leaves out the signature verification and payload translation code.",[201,292,293,294,297,298,301,302,279,305,308,309,312,313,279,316,319],{},"On a Lite provider, ",[205,295,296],{},"capabilities.sources.webhook"," is ",[205,299,300],{},"false",", and ",[205,303,304],{},"webhooks.verify()",[205,306,307],{},"webhooks.ingest()"," reject with ",[205,310,311],{},"UnsupportedOperationError",". All other operations work the same way, including webhook management with ",[205,314,315],{},"webhooks.create()",[205,317,318],{},"webhooks.list()",".",[201,321,322,323,326],{},"pushin.eu has no Lite factory because ",[205,324,325],{},"pushin()"," contains no webhook code.",[210,328,330],{"id":329},"graphql-on-github","GraphQL on GitHub",[201,332,333,335,336,339,340,343,344,347],{},[205,334,255],{}," loads its GraphQL documents with a dynamic ",[205,337,338],{},"import()"," the first time it needs them, so your bundler emits them as a separate chunk. Discussions and their reactions, ",[205,341,342],{},"threads.getMany()",", review threads, subscriptions, transfers and duplicate marking use GraphQL. ",[205,345,346],{},"threads.list()"," also uses it to read the checks of each pull request in a page. Code that calls only REST operations doesn't load the chunk.",[201,349,350],{},"An anonymous GitHub provider doesn't use GraphQL, because GitHub requires a credential for its GraphQL API.",[210,352,354],{"id":353},"test-modules","Test modules",[201,356,357,279,360,363],{},[205,358,359],{},"forges\u002Ffake",[205,361,362],{},"forges\u002Ftesting"," are for tests. Leave them out of production bundles.",[201,365,366,369,370,372,373,376],{},[205,367,368],{},"loadFixtures()"," in ",[205,371,362],{}," imports ",[205,374,375],{},"node:fs"," when you call it. No other entry imports a Node.js built-in module.",[210,378,380],{"id":379},"sizes","Sizes",[201,382,383],{},"The following table compares the Lite factory of each provider with an existing client for the same forge. Each row is a one-line import, bundled for the browser with rolldown and minified:",[385,386,387,405],"table",{},[388,389,390],"thead",{},[391,392,393,397,402],"tr",{},[394,395,396],"th",{},"Forge",[394,398,399,401],{},[205,400,207],{}," (Lite)",[394,403,404],{},"Existing client",[406,407,408,422,435,449],"tbody",{},[391,409,410,413,416],{},[411,412,118],"td",{},[411,414,415],{},"79.8 kB, 24.3 kB gzip",[411,417,418,421],{},[205,419,420],{},"@octokit\u002Frest"," 22: 105.7 kB, 21.1 kB gzip",[391,423,424,426,429],{},[411,425,122],{},[411,427,428],{},"63.1 kB, 19.7 kB gzip",[411,430,431,434],{},[205,432,433],{},"@gitbeaker\u002Frest"," 43: 233.7 kB, 55.3 kB gzip",[391,436,437,440,443],{},[411,438,439],{},"Gitea \u002F Forgejo",[411,441,442],{},"55.6 kB, 17.2 kB gzip",[411,444,445,448],{},[205,446,447],{},"gitea-js"," 1.23: 54.9 kB, 6.8 kB gzip",[391,450,451,454,457],{},[411,452,453],{},"Bitbucket",[411,455,456],{},"50.5 kB, 15.9 kB gzip",[411,458,459,462],{},[205,460,461],{},"bitbucket"," 2.12: 110.4 kB, 15.0 kB gzip",[201,464,465,466,468],{},"The existing clients cover every endpoint and return each forge's raw responses. ",[205,467,207],{}," covers fewer operations and returns the shared model, with capabilities, pagination and warnings. A provider is bundled whole: importing one forge leaves out the other forges, but it keeps the operations you don't call.",[210,470,472],{"id":471},"size-budgets","Size budgets",[201,474,475,478,479,488],{},[205,476,477],{},"pnpm test:size"," runs ",[480,481,485],"a",{"href":482,"rel":483},"https:\u002F\u002Fgithub.com\u002Fdanielroe\u002Fforges\u002Fblob\u002Fmain\u002Fscripts\u002Fbundle-size.ts",[484],"nofollow",[205,486,487],{},"scripts\u002Fbundle-size.ts",". For each entry with a budget, the script bundles a one-line browser consumer with rolldown, the bundler that Vite uses. It measures the entry chunk minified and gzipped, and reports lazy chunks separately. Lazy chunks don't count toward the budget.",[201,490,491],{},"The script fails in two cases:",[493,494,495,499],"ul",{},[496,497,498],"li",{},"An entry is over its budget.",[496,500,501,502,319],{},"A Lite bundle contains a string that only the webhook code uses, such as ",[205,503,504],{},"x-hub-signature-256",[201,506,507,508,511],{},"The script measures ",[205,509,510],{},"dist",", so build first:",[218,513,517],{"className":514,"code":515,"language":516,"meta":223,"style":223},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm build\npnpm test:size\n","sh",[205,518,519,524],{"__ignoreMap":223},[227,520,521],{"class":229,"line":230},[227,522,523],{},"pnpm build\n",[227,525,527],{"class":229,"line":526},2,[227,528,529],{},"pnpm test:size\n",[201,531,532,533,536],{},"To print the sizes without failing, pass ",[205,534,535],{},"--report",":",[218,538,540],{"className":514,"code":539,"language":516,"meta":223,"style":223},"node scripts\u002Fbundle-size.ts --report\n",[205,541,542],{"__ignoreMap":223},[227,543,544],{"class":229,"line":230},[227,545,539],{},[547,548,549],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":223,"searchDepth":526,"depth":526,"links":551},[552,553,554,555,556,557],{"id":212,"depth":526,"text":213},{"id":271,"depth":526,"text":272},{"id":329,"depth":526,"text":330},{"id":353,"depth":526,"text":354},{"id":379,"depth":526,"text":380},{"id":471,"depth":526,"text":472},"Keep forges small in a browser bundle, and see how CI checks the sizes.","md",null,{"icon":562},"i-lucide-package",true,{"title":58,"description":558},"gEv-zW-q6gLPgeP8exR0StqhrmhHJVhU3GPnZUS5WY0",[567,569],{"title":54,"path":55,"stem":56,"description":568,"children":-1},"Iterate over listings, or fetch one page at a time and resume later.",{"title":62,"path":63,"stem":64,"description":570,"children":-1},"Run your code against an in-memory forge or recorded responses.",1791294003829]