[{"data":1,"prerenderedAt":739},["ShallowReactive",2],{"navigation_docs":3,"-guides-capabilities":195,"-guides-capabilities-surround":734},[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":46,"body":197,"description":727,"extension":728,"links":729,"meta":730,"navigation":621,"path":47,"seo":732,"stem":48,"__hash__":733},"docs\u002F2.guides\u002F5.capabilities.md",{"type":198,"value":199,"toc":719},"minimark",[200,212,221,232,342,377,415,419,426,577,581,587,648,652,665,693,697,715],[201,202,203,207,208,211],"p",{},[204,205,206],"code",{},"provider.capabilities"," describes what a provider supports. The provider computes it without a network request. ",[209,210,76],"a",{"href":77}," explains the four values.",[213,214,216,217,220],"h2",{"id":215},"call-can-before-an-operation","Call ",[204,218,219],{},"can()"," before an operation",[201,222,223,224,227,228,231],{},"A verb is the path of the method on the provider, such as ",[204,225,226],{},"threads.addLabels"," or ",[204,229,230],{},"webhooks.create",". Pass the thread kind as well when support differs by kind:",[233,234,239],"pre",{"className":235,"code":236,"language":237,"meta":238,"style":238},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","if (gh.can('threads.addLabels', thread.ref.kind)) {\n  await gh.threads.addLabels(thread.ref, ['triage'])\n}\n","ts","",[204,240,241,292,336],{"__ignoreMap":238},[242,243,246,250,254,258,262,265,268,271,273,276,279,281,284,286,289],"span",{"class":244,"line":245},"line",1,[242,247,249],{"class":248},"s7zQu","if",[242,251,253],{"class":252},"sTEyZ"," (gh",[242,255,257],{"class":256},"sMK4o",".",[242,259,261],{"class":260},"s2Zo4","can",[242,263,264],{"class":252},"(",[242,266,267],{"class":256},"'",[242,269,226],{"class":270},"sfazB",[242,272,267],{"class":256},[242,274,275],{"class":256},",",[242,277,278],{"class":252}," thread",[242,280,257],{"class":256},[242,282,283],{"class":252},"ref",[242,285,257],{"class":256},[242,287,288],{"class":252},"kind)) ",[242,290,291],{"class":256},"{\n",[242,293,295,298,301,303,306,308,311,314,317,319,321,323,326,328,331,333],{"class":244,"line":294},2,[242,296,297],{"class":248},"  await",[242,299,300],{"class":252}," gh",[242,302,257],{"class":256},[242,304,305],{"class":252},"threads",[242,307,257],{"class":256},[242,309,310],{"class":260},"addLabels",[242,312,264],{"class":313},"swJcz",[242,315,316],{"class":252},"thread",[242,318,257],{"class":256},[242,320,283],{"class":252},[242,322,275],{"class":256},[242,324,325],{"class":313}," [",[242,327,267],{"class":256},[242,329,330],{"class":270},"triage",[242,332,267],{"class":256},[242,334,335],{"class":313},"])\n",[242,337,339],{"class":244,"line":338},3,[242,340,341],{"class":256},"}\n",[201,343,344,346,347,350,351,353,354,357,358,361,362,365,366,369,370,372,373,376],{},[204,345,219],{}," returns ",[204,348,349],{},"true"," for ",[204,352,349],{},", ",[204,355,356],{},"'experimental'",", and ",[204,359,360],{},"'emulated'",". To treat experimental or emulated support differently, read the value from ",[204,363,364],{},"capabilities",". Its keys follow the ",[209,367,368],{"href":145},"capability matrix",", so ",[204,371,226],{}," is ",[204,374,375],{},"capabilities.writes.addLabels",":",[233,378,380],{"className":235,"code":379,"language":237,"meta":238,"style":238},"const support = provider.capabilities.writes.addLabels.issue\n",[204,381,382],{"__ignoreMap":238},[242,383,384,388,391,394,397,399,401,403,406,408,410,412],{"class":244,"line":245},[242,385,387],{"class":386},"spNyl","const",[242,389,390],{"class":252}," support ",[242,392,393],{"class":256},"=",[242,395,396],{"class":252}," provider",[242,398,257],{"class":256},[242,400,364],{"class":252},[242,402,257],{"class":256},[242,404,405],{"class":252},"writes",[242,407,257],{"class":256},[242,409,310],{"class":252},[242,411,257],{"class":256},[242,413,414],{"class":252},"issue\n",[213,416,418],{"id":417},"provide-a-fallback","Provide a fallback",[201,420,421,422,425],{},"Every method exists on every provider. A method for an unsupported operation rejects with ",[204,423,424],{},"UnsupportedOperationError",". Check first, and choose what to do instead:",[233,427,429],{"className":235,"code":428,"language":237,"meta":238,"style":238},"if (provider.can('threads.upsertComment', thread.ref.kind)) {\n  await provider.threads.upsertComment(thread.ref, {\n    key: 'ci-report',\n    body,\n  })\n}\nelse {\n  await provider.threads.comment(thread.ref, body)\n}\n",[204,430,431,465,493,511,519,528,533,541,572],{"__ignoreMap":238},[242,432,433,435,438,440,442,444,446,449,451,453,455,457,459,461,463],{"class":244,"line":245},[242,434,249],{"class":248},[242,436,437],{"class":252}," (provider",[242,439,257],{"class":256},[242,441,261],{"class":260},[242,443,264],{"class":252},[242,445,267],{"class":256},[242,447,448],{"class":270},"threads.upsertComment",[242,450,267],{"class":256},[242,452,275],{"class":256},[242,454,278],{"class":252},[242,456,257],{"class":256},[242,458,283],{"class":252},[242,460,257],{"class":256},[242,462,288],{"class":252},[242,464,291],{"class":256},[242,466,467,469,471,473,475,477,480,482,484,486,488,490],{"class":244,"line":294},[242,468,297],{"class":248},[242,470,396],{"class":252},[242,472,257],{"class":256},[242,474,305],{"class":252},[242,476,257],{"class":256},[242,478,479],{"class":260},"upsertComment",[242,481,264],{"class":313},[242,483,316],{"class":252},[242,485,257],{"class":256},[242,487,283],{"class":252},[242,489,275],{"class":256},[242,491,492],{"class":256}," {\n",[242,494,495,498,500,503,506,508],{"class":244,"line":338},[242,496,497],{"class":313},"    key",[242,499,376],{"class":256},[242,501,502],{"class":256}," '",[242,504,505],{"class":270},"ci-report",[242,507,267],{"class":256},[242,509,510],{"class":256},",\n",[242,512,514,517],{"class":244,"line":513},4,[242,515,516],{"class":252},"    body",[242,518,510],{"class":256},[242,520,522,525],{"class":244,"line":521},5,[242,523,524],{"class":256},"  }",[242,526,527],{"class":313},")\n",[242,529,531],{"class":244,"line":530},6,[242,532,341],{"class":256},[242,534,536,539],{"class":244,"line":535},7,[242,537,538],{"class":248},"else",[242,540,492],{"class":256},[242,542,544,546,548,550,552,554,557,559,561,563,565,567,570],{"class":244,"line":543},8,[242,545,297],{"class":248},[242,547,396],{"class":252},[242,549,257],{"class":256},[242,551,305],{"class":252},[242,553,257],{"class":256},[242,555,556],{"class":260},"comment",[242,558,264],{"class":313},[242,560,316],{"class":252},[242,562,257],{"class":256},[242,564,283],{"class":252},[242,566,275],{"class":256},[242,568,569],{"class":252}," body",[242,571,527],{"class":313},[242,573,575],{"class":244,"line":574},9,[242,576,341],{"class":256},[213,578,580],{"id":579},"check-a-stored-capabilities-object","Check a stored capabilities object",[201,582,583,586],{},[204,584,585],{},"supports(capabilities, verb, kind?)"," gives the same answer from a plain capabilities object. Use it with capabilities that you stored or received from another process:",[233,588,590],{"className":235,"code":589,"language":237,"meta":238,"style":238},"import { supports } from 'forges'\n\nconst canMerge = supports(saved, 'threads.merge')\n",[204,591,592,617,623],{"__ignoreMap":238},[242,593,594,597,600,603,606,609,611,614],{"class":244,"line":245},[242,595,596],{"class":248},"import",[242,598,599],{"class":256}," {",[242,601,602],{"class":252}," supports",[242,604,605],{"class":256}," }",[242,607,608],{"class":248}," from",[242,610,502],{"class":256},[242,612,613],{"class":270},"forges",[242,615,616],{"class":256},"'\n",[242,618,619],{"class":244,"line":294},[242,620,622],{"emptyLinePlaceholder":621},true,"\n",[242,624,625,627,630,632,634,637,639,641,644,646],{"class":244,"line":338},[242,626,387],{"class":386},[242,628,629],{"class":252}," canMerge ",[242,631,393],{"class":256},[242,633,602],{"class":260},[242,635,636],{"class":252},"(saved",[242,638,275],{"class":256},[242,640,502],{"class":256},[242,642,643],{"class":270},"threads.merge",[242,645,267],{"class":256},[242,647,527],{"class":252},[213,649,651],{"id":650},"handle-version-dependent-capabilities","Handle version-dependent capabilities",[201,653,654,655,658,659,662,663,376],{},"Some capabilities depend on the version of the instance. GitHub Enterprise Server supports marking notifications done from version 3.13, for example. Pass ",[204,656,657],{},"instanceVersion"," if you know it. Otherwise, call ",[204,660,661],{},"refreshCapabilities()",", which reads the version once per provider and updates ",[204,664,364],{},[233,666,668],{"className":235,"code":667,"language":237,"meta":238,"style":238},"const capabilities = await forge.refreshCapabilities()\n",[204,669,670],{"__ignoreMap":238},[242,671,672,674,677,679,682,685,687,690],{"class":244,"line":245},[242,673,387],{"class":386},[242,675,676],{"class":252}," capabilities ",[242,678,393],{"class":256},[242,680,681],{"class":248}," await",[242,683,684],{"class":252}," forge",[242,686,257],{"class":256},[242,688,689],{"class":260},"refreshCapabilities",[242,691,692],{"class":252},"()\n",[213,694,696],{"id":695},"find-the-scopes-a-verb-needs","Find the scopes a verb needs",[201,698,699,700,372,702,704,705,708,709,257],{},"When ",[204,701,219],{},[204,703,349],{}," but a call fails with ",[204,706,707],{},"InsufficientScopeError",", use ",[209,710,712],{"href":711},"\u002Fguides\u002Fauthentication#show-the-scopes-an-operation-needs",[204,713,714],{},"scopesFor()",[716,717,718],"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 .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 .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":238,"searchDepth":294,"depth":294,"links":720},[721,723,724,725,726],{"id":215,"depth":294,"text":722},"Call can() before an operation",{"id":417,"depth":294,"text":418},{"id":579,"depth":294,"text":580},{"id":650,"depth":294,"text":651},{"id":695,"depth":294,"text":696},"Ask a provider whether it supports an operation before you call it.","md",null,{"icon":731},"i-lucide-list-checks",{"title":46,"description":727},"AnqAhPmlSZFl7mj0Ktcs2cziUiFCjpFnbnp5kyFhVSs",[735,737],{"title":42,"path":43,"stem":44,"description":736,"children":-1},"Verify a delivery and turn it into normalised events.",{"title":50,"path":51,"stem":52,"description":738,"children":-1},"Catch typed errors, and see how providers retry rate-limited requests.",1791294008143]