[{"data":1,"prerenderedAt":680},["ShallowReactive",2],{"navigation_docs":3,"-concepts-events":195,"-concepts-events-surround":675},[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":84,"body":197,"description":667,"extension":668,"links":669,"meta":670,"navigation":672,"path":85,"seo":673,"stem":86,"__hash__":674},"docs\u002F3.concepts\u002F4.events.md",{"type":198,"value":199,"toc":661},"minimark",[200,209,277,286,291,421,425,448,466,470,488,639,643,657],[201,202,203,204,208],"p",{},"A ",[205,206,207],"code",{},"ForgeEvent"," describes something that happened, such as a comment, a push, a review or a label change. Providers produce events from three sources:",[210,211,212,228],"table",{},[213,214,215],"thead",{},[216,217,218,222,225],"tr",{},[219,220,221],"th",{},"Source",[219,223,224],{},"How it works",[219,226,227],{},"Capability",[229,230,231,247,262],"tbody",{},[216,232,233,239,242],{},[234,235,236],"td",{},[205,237,238],{},"webhook",[234,240,241],{},"The forge sends an HTTP request to your server.",[234,243,244],{},[205,245,246],{},"sources.webhook",[216,248,249,254,257],{},[234,250,251],{},[205,252,253],{},"poll",[234,255,256],{},"You list notifications or thread events on a schedule.",[234,258,259],{},[205,260,261],{},"sources.poll",[216,263,264,269,272],{},[234,265,266],{},[205,267,268],{},"subscribe",[234,270,271],{},"You keep a connection open and receive events as they happen.",[234,273,274],{},[205,275,276],{},"sources.subscribe",[201,278,279,282,283,285],{},[205,280,281],{},"event.source"," tells you which one delivered an event. Most forges support webhooks. Tangled also offers ",[205,284,268],{}," through Jetstream. GitHub, GitLab, Forgejo, Gitea and Gitee can be polled.",[287,288,290],"h2",{"id":289},"shape-of-an-event","Shape of an event",[210,292,293,303],{},[213,294,295],{},[216,296,297,300],{},[219,298,299],{},"Field",[219,301,302],{},"Content",[229,304,305,335,360,370,386,399,411],{},[216,306,307,312],{},[234,308,309],{},[205,310,311],{},"kind",[234,313,314,315,318,319,318,322,318,325,318,328,331,332],{},"What kind of thing happened, such as ",[205,316,317],{},"comment",", ",[205,320,321],{},"review",[205,323,324],{},"state_change",[205,326,327],{},"label",[205,329,330],{},"push"," or ",[205,333,334],{},"release",[216,336,337,342],{},[234,338,339],{},[205,340,341],{},"action",[234,343,344,345,318,348,318,351,318,354,331,357],{},"The verb, such as ",[205,346,347],{},"opened",[205,349,350],{},"closed",[205,352,353],{},"merged",[205,355,356],{},"created",[205,358,359],{},"labelled",[216,361,362,367],{},[234,363,364],{},[205,365,366],{},"summary",[234,368,369],{},"One line that suits a list row",[216,371,372,383],{},[234,373,374,318,377,318,380],{},[205,375,376],{},"actor",[205,378,379],{},"repo",[205,381,382],{},"thread",[234,384,385],{},"Who did it, and where, when the event has them",[216,387,388,393],{},[234,389,390],{},[205,391,392],{},"detail",[234,394,395,396],{},"Typed fields for the kind, discriminated by ",[205,397,398],{},"detail.type",[216,400,401,406],{},[234,402,403],{},[205,404,405],{},"occurredAt",[234,407,203,408],{},[205,409,410],{},"Date",[216,412,413,418],{},[234,414,415],{},[205,416,417],{},"payload",[234,419,420],{},"The unnormalised delivery",[287,422,424],{"id":423},"raw-names-stay-available","Raw names stay available",[201,426,427,428,430,431,433,434,430,437,440,441,443,444,447],{},"The normalised ",[205,429,311],{}," and ",[205,432,341],{}," come from a forge's own event name and verb, which stay in ",[205,435,436],{},"kindRaw",[205,438,439],{},"actionRaw",". When a forge uses wording that has no equivalent, ",[205,442,341],{}," is ",[205,445,446],{},"other"," and the raw name still tells you what happened.",[201,449,450,451,454,455,457,458,460,461,430,463,465],{},"On GitLab, event kinds for some thread changes come from the text of system notes rather than a field. That provider reports ",[205,452,453],{},"eventKinds: 'heuristic'"," in its capabilities. For an unrecognised note, ",[205,456,311],{}," can be ",[205,459,446],{},", and ",[205,462,436],{},[205,464,417],{}," stay exact.",[287,467,469],{"id":468},"subscriptions","Subscriptions",[201,471,472,475,476,479,480,483,484,487],{},[205,473,474],{},"sources.subscribe()"," returns an async iterable of ",[205,477,478],{},"{ event, cursor }",". Save the cursor and pass it back to resume. The provider doesn't reconnect when the connection drops. It throws ",[205,481,482],{},"SubscriptionClosedError"," with the last cursor, and you call ",[205,485,486],{},"subscribe()"," again:",[489,490,495],"pre",{"className":491,"code":492,"language":493,"meta":494,"style":494},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","for await (const { event, cursor } of reader.sources.subscribe({\n  cursor: saved,\n  signal,\n})) {\n  console.log(event.kind, event.summary)\n  saved = cursor\n}\n","ts","",[205,496,497,556,572,580,590,621,633],{"__ignoreMap":494},[498,499,502,506,509,513,517,521,524,527,530,533,536,539,542,545,547,550,553],"span",{"class":500,"line":501},"line",1,[498,503,505],{"class":504},"s7zQu","for",[498,507,508],{"class":504}," await",[498,510,512],{"class":511},"sTEyZ"," (",[498,514,516],{"class":515},"spNyl","const",[498,518,520],{"class":519},"sMK4o"," {",[498,522,523],{"class":511}," event",[498,525,526],{"class":519},",",[498,528,529],{"class":511}," cursor ",[498,531,532],{"class":519},"}",[498,534,535],{"class":519}," of",[498,537,538],{"class":511}," reader",[498,540,541],{"class":519},".",[498,543,544],{"class":511},"sources",[498,546,541],{"class":519},[498,548,268],{"class":549},"s2Zo4",[498,551,552],{"class":511},"(",[498,554,555],{"class":519},"{\n",[498,557,559,563,566,569],{"class":500,"line":558},2,[498,560,562],{"class":561},"swJcz","  cursor",[498,564,565],{"class":519},":",[498,567,568],{"class":511}," saved",[498,570,571],{"class":519},",\n",[498,573,575,578],{"class":500,"line":574},3,[498,576,577],{"class":511},"  signal",[498,579,571],{"class":519},[498,581,583,585,588],{"class":500,"line":582},4,[498,584,532],{"class":519},[498,586,587],{"class":511},")) ",[498,589,555],{"class":519},[498,591,593,596,598,601,603,606,608,610,612,614,616,618],{"class":500,"line":592},5,[498,594,595],{"class":511},"  console",[498,597,541],{"class":519},[498,599,600],{"class":549},"log",[498,602,552],{"class":561},[498,604,605],{"class":511},"event",[498,607,541],{"class":519},[498,609,311],{"class":511},[498,611,526],{"class":519},[498,613,523],{"class":511},[498,615,541],{"class":519},[498,617,366],{"class":511},[498,619,620],{"class":561},")\n",[498,622,624,627,630],{"class":500,"line":623},6,[498,625,626],{"class":511},"  saved",[498,628,629],{"class":519}," =",[498,631,632],{"class":511}," cursor\n",[498,634,636],{"class":500,"line":635},7,[498,637,638],{"class":519},"}\n",[287,640,642],{"id":641},"next-steps","Next steps",[644,645,646,652],"ul",{},[647,648,649],"li",{},[650,651,42],"a",{"href":43},[647,653,654,656],{},[650,655,54],{"href":55}," for polling with cursors",[658,659,660],"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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .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);}",{"title":494,"searchDepth":558,"depth":558,"links":662},[663,664,665,666],{"id":289,"depth":558,"text":290},{"id":423,"depth":558,"text":424},{"id":468,"depth":558,"text":469},{"id":641,"depth":558,"text":642},"How code forges deliver changes, and how providers turn them into one event type.","md",null,{"icon":671},"i-lucide-radio",true,{"title":84,"description":667},"Z9IKvxkpTehpPsOBvcH9NEOCLYAObC--c5c65z0G9rA",[676,678],{"title":80,"path":81,"stem":82,"description":677,"children":-1},"How provider functions, factories and Lite variants fit together.",{"title":94,"path":95,"stem":96,"description":679,"children":-1},"Use Azure Repos pull requests and Azure Boards work items on Azure DevOps Services and Server.",1791294007554]