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