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