[{"data":1,"prerenderedAt":575},["ShallowReactive",2],{"navigation_docs":3,"-guides-bundling":199,"-guides-bundling-surround":570},[4,23,65,87,133,159,177],{"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,155],{"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},"Environment variables","\u002Freference\u002Fenvironment-variables","5.reference\u002F4.environment-variables",{"title":156,"path":157,"stem":158},"JSON Schemas","\u002Freference\u002Fjson-schemas","5.reference\u002F5.json-schemas",{"title":160,"icon":161,"path":162,"stem":163,"children":164,"page":22},"Examples","i-lucide-boxes","\u002Fexamples","6.examples",[165,169,173],{"title":166,"path":167,"stem":168},"Inbox CLI","\u002Fexamples\u002Finbox-cli","6.examples\u002F1.inbox-cli",{"title":170,"path":171,"stem":172},"Label bot","\u002Fexamples\u002Flabel-bot","6.examples\u002F2.label-bot",{"title":174,"path":175,"stem":176},"Release digest","\u002Fexamples\u002Frelease-digest","6.examples\u002F3.release-digest",{"title":178,"icon":179,"path":180,"stem":181,"children":182,"page":22},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","7.contributing",[183,187,191,195],{"title":184,"path":185,"stem":186},"Contribution guide","\u002Fcontributing\u002Fguidelines","7.contributing\u002F1.guidelines",{"title":188,"path":189,"stem":190},"Write a provider","\u002Fcontributing\u002Fwrite-a-provider","7.contributing\u002F2.write-a-provider",{"title":192,"path":193,"stem":194},"Record fixtures","\u002Fcontributing\u002Frecord-fixtures","7.contributing\u002F3.record-fixtures",{"title":196,"path":197,"stem":198},"Contributors","\u002Fcontributing\u002Fcontributors","7.contributing\u002F4.contributors",{"id":200,"title":58,"body":201,"description":562,"extension":563,"links":564,"meta":565,"navigation":567,"path":59,"seo":568,"stem":60,"__hash__":569},"docs\u002F2.guides\u002F8.bundling.md",{"type":202,"value":203,"toc":554},"minimark",[204,213,218,221,263,273,277,295,324,331,335,352,355,359,368,381,385,388,467,473,477,493,496,509,516,534,541,550],[205,206,207,208,212],"p",{},"This page explains how to keep ",[209,210,211],"code",{},"forges"," small in a browser bundle and how CI checks the bundle sizes.",[214,215,217],"h2",{"id":216},"import-one-forge","Import one forge",[205,219,220],{},"Each provider has its own subpath export. Import from the subpath to bundle only the forges you use:",[222,223,228],"pre",{"className":224,"code":225,"language":226,"meta":227,"style":227},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { githubLite } from 'forges\u002Fgithub'\n","ts","",[209,229,230],{"__ignoreMap":227},[231,232,235,239,243,247,250,253,256,260],"span",{"class":233,"line":234},"line",1,[231,236,238],{"class":237},"s7zQu","import",[231,240,242],{"class":241},"sMK4o"," {",[231,244,246],{"class":245},"sTEyZ"," githubLite",[231,248,249],{"class":241}," }",[231,251,252],{"class":237}," from",[231,254,255],{"class":241}," '",[231,257,259],{"class":258},"sfazB","forges\u002Fgithub",[231,261,262],{"class":241},"'\n",[205,264,265,266,268,269,272],{},"The root ",[209,267,211],{}," entry re-exports every provider. The package declares ",[209,270,271],{},"sideEffects: false",", so bundlers can tree-shake the root entry, but a subpath import makes the dependency explicit.",[214,274,276],{"id":275},"use-the-lite-factory","Use the Lite factory",[205,278,279,280,283,284,287,288,290,291,294],{},"Every provider except pushin.eu exports two factories, ",[209,281,282],{},"\u003Ckind>()"," and ",[209,285,286],{},"\u003Ckind>Lite()",". Both build the same provider. Only ",[209,289,282],{}," references the webhook handlers. A browser doesn't receive webhook deliveries, so a bundle that imports only ",[209,292,293],{},"githubLite"," leaves out the signature verification and payload translation code.",[205,296,297,298,301,302,305,306,283,309,312,313,316,317,283,320,323],{},"On a Lite provider, ",[209,299,300],{},"capabilities.sources.webhook"," is ",[209,303,304],{},"false",", and ",[209,307,308],{},"webhooks.verify()",[209,310,311],{},"webhooks.ingest()"," reject with ",[209,314,315],{},"UnsupportedOperationError",". All other operations work the same way, including webhook management with ",[209,318,319],{},"webhooks.create()",[209,321,322],{},"webhooks.list()",".",[205,325,326,327,330],{},"pushin.eu has no Lite factory because ",[209,328,329],{},"pushin()"," contains no webhook code.",[214,332,334],{"id":333},"graphql-on-github","GraphQL on GitHub",[205,336,337,339,340,343,344,347,348,351],{},[209,338,259],{}," loads its GraphQL documents with a dynamic ",[209,341,342],{},"import()"," the first time it needs them, so your bundler emits them as a separate chunk. Discussions and their reactions, ",[209,345,346],{},"threads.getMany()",", review threads, subscriptions, transfers and duplicate marking use GraphQL. ",[209,349,350],{},"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.",[205,353,354],{},"An anonymous GitHub provider doesn't use GraphQL, because GitHub requires a credential for its GraphQL API.",[214,356,358],{"id":357},"test-modules","Test modules",[205,360,361,283,364,367],{},[209,362,363],{},"forges\u002Ffake",[209,365,366],{},"forges\u002Ftesting"," are for tests. Leave them out of production bundles.",[205,369,370,373,374,376,377,380],{},[209,371,372],{},"loadFixtures()"," in ",[209,375,366],{}," imports ",[209,378,379],{},"node:fs"," when you call it. No other entry imports a Node.js built-in module.",[214,382,384],{"id":383},"sizes","Sizes",[205,386,387],{},"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:",[389,390,391,409],"table",{},[392,393,394],"thead",{},[395,396,397,401,406],"tr",{},[398,399,400],"th",{},"Forge",[398,402,403,405],{},[209,404,211],{}," (Lite)",[398,407,408],{},"Existing client",[410,411,412,426,439,453],"tbody",{},[395,413,414,417,420],{},[415,416,118],"td",{},[415,418,419],{},"79.8 kB, 24.3 kB gzip",[415,421,422,425],{},[209,423,424],{},"@octokit\u002Frest"," 22: 105.7 kB, 21.1 kB gzip",[395,427,428,430,433],{},[415,429,122],{},[415,431,432],{},"63.1 kB, 19.7 kB gzip",[415,434,435,438],{},[209,436,437],{},"@gitbeaker\u002Frest"," 43: 233.7 kB, 55.3 kB gzip",[395,440,441,444,447],{},[415,442,443],{},"Gitea \u002F Forgejo",[415,445,446],{},"55.6 kB, 17.2 kB gzip",[415,448,449,452],{},[209,450,451],{},"gitea-js"," 1.23: 54.9 kB, 6.8 kB gzip",[395,454,455,458,461],{},[415,456,457],{},"Bitbucket",[415,459,460],{},"50.5 kB, 15.9 kB gzip",[415,462,463,466],{},[209,464,465],{},"bitbucket"," 2.12: 110.4 kB, 15.0 kB gzip",[205,468,469,470,472],{},"The existing clients cover every endpoint and return each forge's raw responses. ",[209,471,211],{}," 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.",[214,474,476],{"id":475},"size-budgets","Size budgets",[205,478,479,482,483,492],{},[209,480,481],{},"pnpm test:size"," runs ",[484,485,489],"a",{"href":486,"rel":487},"https:\u002F\u002Fgithub.com\u002Fdanielroe\u002Fforges\u002Fblob\u002Fmain\u002Fscripts\u002Fbundle-size.ts",[488],"nofollow",[209,490,491],{},"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.",[205,494,495],{},"The script fails in two cases:",[497,498,499,503],"ul",{},[500,501,502],"li",{},"An entry is over its budget.",[500,504,505,506,323],{},"A Lite bundle contains a string that only the webhook code uses, such as ",[209,507,508],{},"x-hub-signature-256",[205,510,511,512,515],{},"The script measures ",[209,513,514],{},"dist",", so build first:",[222,517,521],{"className":518,"code":519,"language":520,"meta":227,"style":227},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm build\npnpm test:size\n","sh",[209,522,523,528],{"__ignoreMap":227},[231,524,525],{"class":233,"line":234},[231,526,527],{},"pnpm build\n",[231,529,531],{"class":233,"line":530},2,[231,532,533],{},"pnpm test:size\n",[205,535,536,537,540],{},"To print the sizes without failing, pass ",[209,538,539],{},"--report",":",[222,542,544],{"className":518,"code":543,"language":520,"meta":227,"style":227},"node scripts\u002Fbundle-size.ts --report\n",[209,545,546],{"__ignoreMap":227},[231,547,548],{"class":233,"line":234},[231,549,543],{},[551,552,553],"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":227,"searchDepth":530,"depth":530,"links":555},[556,557,558,559,560,561],{"id":216,"depth":530,"text":217},{"id":275,"depth":530,"text":276},{"id":333,"depth":530,"text":334},{"id":357,"depth":530,"text":358},{"id":383,"depth":530,"text":384},{"id":475,"depth":530,"text":476},"Keep forges small in a browser bundle, and see how CI checks the sizes.","md",null,{"icon":566},"i-lucide-package",true,{"title":58,"description":562},"gEv-zW-q6gLPgeP8exR0StqhrmhHJVhU3GPnZUS5WY0",[571,573],{"title":54,"path":55,"stem":56,"description":572,"children":-1},"Iterate over listings, or fetch one page at a time and resume later.",{"title":62,"path":63,"stem":64,"description":574,"children":-1},"Run your code against an in-memory forge or recorded responses.",1791296689727]