[{"data":1,"prerenderedAt":798},["ShallowReactive",2],{"navigation_docs":3,"-guides-pagination":199,"-guides-pagination-surround":793},[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":54,"body":201,"description":786,"extension":787,"links":788,"meta":789,"navigation":264,"path":55,"seo":791,"stem":56,"__hash__":792},"docs\u002F2.guides\u002F7.pagination.md",{"type":202,"value":203,"toc":781},"minimark",[204,217,222,229,406,421,425,443,536,541,632,635,639,653,771,777],[205,206,207,208,212,213,216],"p",{},"Most listings come in two forms. ",[209,210,211],"code",{},"list()"," returns an async iterable that fetches pages as the loop needs them. ",[209,214,215],{},"listPage()"," returns one page.",[218,219,221],"h2",{"id":220},"iterate","Iterate",[205,223,224,225,228],{},"Use ",[209,226,227],{},"for await"," when you want every item, or the first few:",[230,231,236],"pre",{"className":232,"code":233,"language":234,"meta":235,"style":235},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","let seen = 0\n\nfor await (const thread of gh.threads.list(repo, { state: 'open' })) {\n  console.log(thread.title)\n  if (++seen === 20) {\n    break\n  }\n}\n","ts","",[209,237,238,259,266,338,363,388,394,400],{"__ignoreMap":235},[239,240,243,247,251,255],"span",{"class":241,"line":242},"line",1,[239,244,246],{"class":245},"spNyl","let",[239,248,250],{"class":249},"sTEyZ"," seen ",[239,252,254],{"class":253},"sMK4o","=",[239,256,258],{"class":257},"sbssI"," 0\n",[239,260,262],{"class":241,"line":261},2,[239,263,265],{"emptyLinePlaceholder":264},true,"\n",[239,267,269,273,276,279,282,285,288,291,294,297,299,303,306,309,312,316,319,322,326,329,332,335],{"class":241,"line":268},3,[239,270,272],{"class":271},"s7zQu","for",[239,274,275],{"class":271}," await",[239,277,278],{"class":249}," (",[239,280,281],{"class":245},"const",[239,283,284],{"class":249}," thread ",[239,286,287],{"class":253},"of",[239,289,290],{"class":249}," gh",[239,292,293],{"class":253},".",[239,295,296],{"class":249},"threads",[239,298,293],{"class":253},[239,300,302],{"class":301},"s2Zo4","list",[239,304,305],{"class":249},"(repo",[239,307,308],{"class":253},",",[239,310,311],{"class":253}," {",[239,313,315],{"class":314},"swJcz"," state",[239,317,318],{"class":253},":",[239,320,321],{"class":253}," '",[239,323,325],{"class":324},"sfazB","open",[239,327,328],{"class":253},"'",[239,330,331],{"class":253}," }",[239,333,334],{"class":249},")) ",[239,336,337],{"class":253},"{\n",[239,339,341,344,346,349,352,355,357,360],{"class":241,"line":340},4,[239,342,343],{"class":249},"  console",[239,345,293],{"class":253},[239,347,348],{"class":301},"log",[239,350,351],{"class":314},"(",[239,353,354],{"class":249},"thread",[239,356,293],{"class":253},[239,358,359],{"class":249},"title",[239,361,362],{"class":314},")\n",[239,364,366,369,371,374,377,380,383,386],{"class":241,"line":365},5,[239,367,368],{"class":271},"  if",[239,370,278],{"class":314},[239,372,373],{"class":253},"++",[239,375,376],{"class":249},"seen",[239,378,379],{"class":253}," ===",[239,381,382],{"class":257}," 20",[239,384,385],{"class":314},") ",[239,387,337],{"class":253},[239,389,391],{"class":241,"line":390},6,[239,392,393],{"class":271},"    break\n",[239,395,397],{"class":241,"line":396},7,[239,398,399],{"class":253},"  }\n",[239,401,403],{"class":241,"line":402},8,[239,404,405],{"class":253},"}\n",[205,407,408,409,412,413,416,417,420],{},"A ",[209,410,411],{},"break"," stops the requests. ",[209,414,415],{},"perPage"," sets the page size, and ",[209,418,419],{},"signal"," aborts the listing.",[218,422,424],{"id":423},"fetch-a-page","Fetch a page",[205,426,427,428,431,432,435,436,439,440,318],{},"A page has ",[209,429,430],{},"items"," and an optional ",[209,433,434],{},"cursor",". Where the forge reports them, it also has ",[209,437,438],{},"rateLimit"," and ",[209,441,442],{},"warnings",[230,444,446],{"className":232,"code":445,"language":234,"meta":235,"style":235},"const page = await gh.threads.listPage(repo, { perPage: 50 })\n\nfor (const thread of page.items) {\n  console.log(thread.title)\n}\n",[209,447,448,488,492,514,532],{"__ignoreMap":235},[239,449,450,452,455,457,459,461,463,465,467,470,472,474,476,479,481,484,486],{"class":241,"line":242},[239,451,281],{"class":245},[239,453,454],{"class":249}," page ",[239,456,254],{"class":253},[239,458,275],{"class":271},[239,460,290],{"class":249},[239,462,293],{"class":253},[239,464,296],{"class":249},[239,466,293],{"class":253},[239,468,469],{"class":301},"listPage",[239,471,305],{"class":249},[239,473,308],{"class":253},[239,475,311],{"class":253},[239,477,478],{"class":314}," perPage",[239,480,318],{"class":253},[239,482,483],{"class":257}," 50",[239,485,331],{"class":253},[239,487,362],{"class":249},[239,489,490],{"class":241,"line":261},[239,491,265],{"emptyLinePlaceholder":264},[239,493,494,496,498,500,502,504,507,509,512],{"class":241,"line":268},[239,495,272],{"class":271},[239,497,278],{"class":249},[239,499,281],{"class":245},[239,501,284],{"class":249},[239,503,287],{"class":253},[239,505,506],{"class":249}," page",[239,508,293],{"class":253},[239,510,511],{"class":249},"items) ",[239,513,337],{"class":253},[239,515,516,518,520,522,524,526,528,530],{"class":241,"line":340},[239,517,343],{"class":249},[239,519,293],{"class":253},[239,521,348],{"class":301},[239,523,351],{"class":314},[239,525,354],{"class":249},[239,527,293],{"class":253},[239,529,359],{"class":249},[239,531,362],{"class":314},[239,533,534],{"class":241,"line":365},[239,535,405],{"class":253},[205,537,538,540],{},[209,539,434],{}," is absent when the listing is exhausted. Otherwise, pass it back in the options to read the next page:",[230,542,544],{"className":232,"code":543,"language":234,"meta":235,"style":235},"if (page.cursor) {\n  const next = await gh.threads.listPage(repo, {\n    perPage: 50,\n    cursor: page.cursor,\n  })\n}\n",[209,545,546,561,594,606,621,628],{"__ignoreMap":235},[239,547,548,551,554,556,559],{"class":241,"line":242},[239,549,550],{"class":271},"if",[239,552,553],{"class":249}," (page",[239,555,293],{"class":253},[239,557,558],{"class":249},"cursor) ",[239,560,337],{"class":253},[239,562,563,566,569,572,574,576,578,580,582,584,586,589,591],{"class":241,"line":261},[239,564,565],{"class":245},"  const",[239,567,568],{"class":249}," next",[239,570,571],{"class":253}," =",[239,573,275],{"class":271},[239,575,290],{"class":249},[239,577,293],{"class":253},[239,579,296],{"class":249},[239,581,293],{"class":253},[239,583,469],{"class":301},[239,585,351],{"class":314},[239,587,588],{"class":249},"repo",[239,590,308],{"class":253},[239,592,593],{"class":253}," {\n",[239,595,596,599,601,603],{"class":241,"line":268},[239,597,598],{"class":314},"    perPage",[239,600,318],{"class":253},[239,602,483],{"class":257},[239,604,605],{"class":253},",\n",[239,607,608,611,613,615,617,619],{"class":241,"line":340},[239,609,610],{"class":314},"    cursor",[239,612,318],{"class":253},[239,614,506],{"class":249},[239,616,293],{"class":253},[239,618,434],{"class":249},[239,620,605],{"class":253},[239,622,623,626],{"class":241,"line":365},[239,624,625],{"class":253},"  }",[239,627,362],{"class":314},[239,629,630],{"class":241,"line":390},[239,631,405],{"class":253},[205,633,634],{},"Persist the whole cursor object and hand it back unchanged. Its fields depend on the forge.",[218,636,638],{"id":637},"poll-for-changes","Poll for changes",[205,640,641,642,645,646,648,649,652],{},"GitHub notifications support conditional requests. The first page has an ",[209,643,644],{},"etag",". To read the first page again, pass it back as the ",[209,647,644],{}," option. When nothing changed, the page has ",[209,650,651],{},"notModified: true"," and no items:",[230,654,656],{"className":232,"code":655,"language":234,"meta":235,"style":235},"let etag: string | undefined\n\nconst page = await gh.notifications.listPage({ etag })\n\nif (!page.notModified) {\n  handle(page.items)\n  etag = page.etag\n}\n",[209,657,658,677,681,715,719,738,753,767],{"__ignoreMap":235},[239,659,660,662,665,667,671,674],{"class":241,"line":242},[239,661,246],{"class":245},[239,663,664],{"class":249}," etag",[239,666,318],{"class":253},[239,668,670],{"class":669},"sBMFI"," string",[239,672,673],{"class":253}," |",[239,675,676],{"class":669}," undefined\n",[239,678,679],{"class":241,"line":261},[239,680,265],{"emptyLinePlaceholder":264},[239,682,683,685,687,689,691,693,695,698,700,702,704,707,710,713],{"class":241,"line":268},[239,684,281],{"class":245},[239,686,454],{"class":249},[239,688,254],{"class":253},[239,690,275],{"class":271},[239,692,290],{"class":249},[239,694,293],{"class":253},[239,696,697],{"class":249},"notifications",[239,699,293],{"class":253},[239,701,469],{"class":301},[239,703,351],{"class":249},[239,705,706],{"class":253},"{",[239,708,709],{"class":249}," etag ",[239,711,712],{"class":253},"}",[239,714,362],{"class":249},[239,716,717],{"class":241,"line":340},[239,718,265],{"emptyLinePlaceholder":264},[239,720,721,723,725,728,731,733,736],{"class":241,"line":365},[239,722,550],{"class":271},[239,724,278],{"class":249},[239,726,727],{"class":253},"!",[239,729,730],{"class":249},"page",[239,732,293],{"class":253},[239,734,735],{"class":249},"notModified) ",[239,737,337],{"class":253},[239,739,740,743,745,747,749,751],{"class":241,"line":390},[239,741,742],{"class":301},"  handle",[239,744,351],{"class":314},[239,746,730],{"class":249},[239,748,293],{"class":253},[239,750,430],{"class":249},[239,752,362],{"class":314},[239,754,755,758,760,762,764],{"class":241,"line":396},[239,756,757],{"class":249},"  etag",[239,759,571],{"class":253},[239,761,506],{"class":249},[239,763,293],{"class":253},[239,765,766],{"class":249},"etag\n",[239,768,769],{"class":241,"line":402},[239,770,405],{"class":253},[205,772,773,774,293],{},"For push delivery instead of polling, see ",[775,776,84],"a",{"href":85},[778,779,780],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":235,"searchDepth":261,"depth":261,"links":782},[783,784,785],{"id":220,"depth":261,"text":221},{"id":423,"depth":261,"text":424},{"id":637,"depth":261,"text":638},"Iterate over listings, or fetch one page at a time and resume later.","md",null,{"icon":790},"i-lucide-list-start",{"title":54,"description":786},"0iku59NGcPJdz5p9gRHdp4p-zdF2vB-TEZprIMIEYt4",[794,796],{"title":50,"path":51,"stem":52,"description":795,"children":-1},"Catch typed errors, and see how providers retry rate-limited requests.",{"title":58,"path":59,"stem":60,"description":797,"children":-1},"Keep forges small in a browser bundle, and see how CI checks the sizes.",1791296694262]