[{"data":1,"prerenderedAt":913},["ShallowReactive",2],{"navigation_docs":3,"-guides-environment":195,"-guides-environment-surround":908},[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":38,"body":197,"description":901,"extension":902,"links":903,"meta":904,"navigation":281,"path":39,"seo":906,"stem":40,"__hash__":907},"docs\u002F2.guides\u002F3.environment.md",{"type":198,"value":199,"toc":895},"minimark",[200,220,225,235,307,311,325,572,576,613,616,755,758,843,851,855,862,884,891],[201,202,203,207,208,211,212,215,216,219],"p",{},[204,205,206],"code",{},"forges\u002Fenv"," creates providers from environment variables, so a CLI or a server can pick up credentials for any forge without code for each one. Each variable has the form ",[204,209,210],{},"FORGES_\u003CKIND>_\u003CFIELD>",", such as ",[204,213,214],{},"FORGES_GITHUB_TOKEN"," or ",[204,217,218],{},"FORGES_GITLAB_BASE_URL",".",[221,222,224],"h2",{"id":223},"create-the-providers","Create the providers",[201,226,227,230,231,234],{},[204,228,229],{},"forgesFromEnv()"," reads the variables and passes every configured provider to ",[204,232,233],{},"createForges()",":",[236,237,242],"pre",{"className":238,"code":239,"language":240,"meta":241,"style":241},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { forgesFromEnv } from 'forges\u002Fenv'\n\nconst forges = forgesFromEnv(process.env)\n","ts","",[204,243,244,276,283],{"__ignoreMap":241},[245,246,249,253,257,261,264,267,270,273],"span",{"class":247,"line":248},"line",1,[245,250,252],{"class":251},"s7zQu","import",[245,254,256],{"class":255},"sMK4o"," {",[245,258,260],{"class":259},"sTEyZ"," forgesFromEnv",[245,262,263],{"class":255}," }",[245,265,266],{"class":251}," from",[245,268,269],{"class":255}," '",[245,271,206],{"class":272},"sfazB",[245,274,275],{"class":255},"'\n",[245,277,279],{"class":247,"line":278},2,[245,280,282],{"emptyLinePlaceholder":281},true,"\n",[245,284,286,290,293,296,299,302,304],{"class":247,"line":285},3,[245,287,289],{"class":288},"spNyl","const",[245,291,292],{"class":259}," forges ",[245,294,295],{"class":255},"=",[245,297,260],{"class":298},"s2Zo4",[245,300,301],{"class":259},"(process",[245,303,219],{"class":255},[245,305,306],{"class":259},"env)\n",[221,308,310],{"id":309},"report-skipped-forges","Report skipped forges",[201,312,313,316,317,320,321,324],{},[204,314,315],{},"providersFromEnv()"," returns one entry for each set of variables. An entry has a ",[204,318,319],{},"factory"," when the variables configure a provider, and a ",[204,322,323],{},"skipped"," reason when they don't. The reason never contains a credential:",[236,326,328],{"className":238,"code":327,"language":240,"meta":241,"style":241},"import { createForges } from 'forges'\nimport { providersFromEnv } from 'forges\u002Fenv'\n\nconst entries = providersFromEnv(process.env)\n\nfor (const entry of entries) {\n  if (entry.skipped) {\n    console.warn(`Skipping ${entry.kind}: ${entry.skipped}`)\n  }\n}\n\nconst forges = createForges(\n  entries.flatMap(entry => entry.factory ? [entry.factory] : []),\n)\n",[204,329,330,350,369,373,391,396,419,440,490,496,502,507,521,567],{"__ignoreMap":241},[245,331,332,334,336,339,341,343,345,348],{"class":247,"line":248},[245,333,252],{"class":251},[245,335,256],{"class":255},[245,337,338],{"class":259}," createForges",[245,340,263],{"class":255},[245,342,266],{"class":251},[245,344,269],{"class":255},[245,346,347],{"class":272},"forges",[245,349,275],{"class":255},[245,351,352,354,356,359,361,363,365,367],{"class":247,"line":278},[245,353,252],{"class":251},[245,355,256],{"class":255},[245,357,358],{"class":259}," providersFromEnv",[245,360,263],{"class":255},[245,362,266],{"class":251},[245,364,269],{"class":255},[245,366,206],{"class":272},[245,368,275],{"class":255},[245,370,371],{"class":247,"line":285},[245,372,282],{"emptyLinePlaceholder":281},[245,374,376,378,381,383,385,387,389],{"class":247,"line":375},4,[245,377,289],{"class":288},[245,379,380],{"class":259}," entries ",[245,382,295],{"class":255},[245,384,358],{"class":298},[245,386,301],{"class":259},[245,388,219],{"class":255},[245,390,306],{"class":259},[245,392,394],{"class":247,"line":393},5,[245,395,282],{"emptyLinePlaceholder":281},[245,397,399,402,405,407,410,413,416],{"class":247,"line":398},6,[245,400,401],{"class":251},"for",[245,403,404],{"class":259}," (",[245,406,289],{"class":288},[245,408,409],{"class":259}," entry ",[245,411,412],{"class":255},"of",[245,414,415],{"class":259}," entries) ",[245,417,418],{"class":255},"{\n",[245,420,422,425,428,431,433,435,438],{"class":247,"line":421},7,[245,423,424],{"class":251},"  if",[245,426,404],{"class":427},"swJcz",[245,429,430],{"class":259},"entry",[245,432,219],{"class":255},[245,434,323],{"class":259},[245,436,437],{"class":427},") ",[245,439,418],{"class":255},[245,441,443,446,448,451,454,457,460,463,465,467,470,473,476,478,480,482,484,487],{"class":247,"line":442},8,[245,444,445],{"class":259},"    console",[245,447,219],{"class":255},[245,449,450],{"class":298},"warn",[245,452,453],{"class":427},"(",[245,455,456],{"class":255},"`",[245,458,459],{"class":272},"Skipping ",[245,461,462],{"class":255},"${",[245,464,430],{"class":259},[245,466,219],{"class":255},[245,468,469],{"class":259},"kind",[245,471,472],{"class":255},"}",[245,474,475],{"class":272},": ",[245,477,462],{"class":255},[245,479,430],{"class":259},[245,481,219],{"class":255},[245,483,323],{"class":259},[245,485,486],{"class":255},"}`",[245,488,489],{"class":427},")\n",[245,491,493],{"class":247,"line":492},9,[245,494,495],{"class":255},"  }\n",[245,497,499],{"class":247,"line":498},10,[245,500,501],{"class":255},"}\n",[245,503,505],{"class":247,"line":504},11,[245,506,282],{"emptyLinePlaceholder":281},[245,508,510,512,514,516,518],{"class":247,"line":509},12,[245,511,289],{"class":288},[245,513,292],{"class":259},[245,515,295],{"class":255},[245,517,338],{"class":298},[245,519,520],{"class":259},"(\n",[245,522,524,527,529,532,534,537,540,543,545,548,551,554,556,559,561,564],{"class":247,"line":523},13,[245,525,526],{"class":259},"  entries",[245,528,219],{"class":255},[245,530,531],{"class":298},"flatMap",[245,533,453],{"class":259},[245,535,430],{"class":536},"sHdIc",[245,538,539],{"class":288}," =>",[245,541,542],{"class":259}," entry",[245,544,219],{"class":255},[245,546,547],{"class":259},"factory ",[245,549,550],{"class":255},"?",[245,552,553],{"class":259}," [entry",[245,555,219],{"class":255},[245,557,558],{"class":259},"factory] ",[245,560,234],{"class":255},[245,562,563],{"class":259}," [])",[245,565,566],{"class":255},",\n",[245,568,570],{"class":247,"line":569},14,[245,571,489],{"class":259},[221,573,575],{"id":574},"variables","Variables",[201,577,578,581,582,585,586,585,589,585,592,585,595,585,598,585,601,585,604,585,607,215,610,219],{},[204,579,580],{},"\u003CKIND>"," is the forge in upper case, with underscores for hyphens: ",[204,583,584],{},"GITHUB",", ",[204,587,588],{},"GITLAB",[204,590,591],{},"BITBUCKET",[204,593,594],{},"FORGEJO",[204,596,597],{},"GITEA",[204,599,600],{},"GITEE",[204,602,603],{},"AZURE_DEVOPS",[204,605,606],{},"CURSOR_ORIGIN",[204,608,609],{},"TANGLED",[204,611,612],{},"PUSHIN",[201,614,615],{},"These fields set the shared provider options:",[617,618,619,632],"table",{},[620,621,622],"thead",{},[623,624,625,629],"tr",{},[626,627,628],"th",{},"Field",[626,630,631],{},"Effect",[633,634,635,650,662,674,686,698,717,738],"tbody",{},[623,636,637,643],{},[638,639,640],"td",{},[204,641,642],{},"TOKEN",[638,644,645,646,649],{},"Sets ",[204,647,648],{},"auth"," to a token",[623,651,652,657],{},[638,653,654],{},[204,655,656],{},"BASE_URL",[638,658,645,659],{},[204,660,661],{},"baseUrl",[623,663,664,669],{},[638,665,666],{},[204,667,668],{},"INSTANCE",[638,670,645,671],{},[204,672,673],{},"instance",[623,675,676,681],{},[638,677,678],{},[204,679,680],{},"INSTANCE_VERSION",[638,682,645,683],{},[204,684,685],{},"instanceVersion",[623,687,688,693],{},[638,689,690],{},[204,691,692],{},"WEBHOOK_SECRET",[638,694,645,695],{},[204,696,697],{},"webhookSecret",[623,699,700,705],{},[638,701,702],{},[204,703,704],{},"READ_ONLY",[638,706,645,707,710,711,215,714],{},[204,708,709],{},"readOnly: true"," when the value is ",[204,712,713],{},"1",[204,715,716],{},"true",[623,718,719,724],{},[638,720,721],{},[204,722,723],{},"ENABLED",[638,725,726,215,728,730,731,215,734,737],{},[204,727,713],{},[204,729,716],{}," creates an anonymous provider without a token. ",[204,732,733],{},"0",[204,735,736],{},"false"," skips the forge",[623,739,740,745],{},[638,741,742],{},[204,743,744],{},"DEMO_REPO",[638,746,645,747,750,751,754],{},[204,748,749],{},"entry.demoRepo"," to an ",[204,752,753],{},"owner\u002Fname"," repository for your code to use, and enables anonymous reads",[201,756,757],{},"Some forges read more fields:",[617,759,760,770],{},[620,761,762],{},[623,763,764,767],{},[626,765,766],{},"Forge",[626,768,769],{},"Fields",[633,771,772,796,810,820],{},[623,773,774,777],{},[638,775,776],{},"GitHub, Cursor Origin",[638,778,779,585,782,785,786,789,790,792,793],{},[204,780,781],{},"APP_ID",[204,783,784],{},"PRIVATE_KEY"," and ",[204,787,788],{},"INSTALLATION_ID"," for app auth. Write the newlines in ",[204,791,784],{}," as ",[204,794,795],{},"\\n",[623,797,798,801],{},[638,799,800],{},"Bitbucket, Azure DevOps",[638,802,803,785,806,809],{},[204,804,805],{},"USERNAME",[204,807,808],{},"PASSWORD"," for Basic auth",[623,811,812,814],{},[638,813,94],{},[638,815,816,819],{},[204,817,818],{},"ORGANIZATION",", which is required",[623,821,822,824],{},[638,823,130],{},[638,825,826,585,829,831,832,835,836,785,839,842],{},[204,827,828],{},"IDENTIFIER",[204,830,808],{}," and an optional ",[204,833,834],{},"PDS"," for an app password. ",[204,837,838],{},"API_URL",[204,840,841],{},"NOTIFICATIONS_URL"," set the service URLs",[201,844,845,846,850],{},"The ",[847,848,849],"a",{"href":90},"provider page"," for each forge explains what these options do.",[221,852,854],{"id":853},"configure-a-second-instance","Configure a second instance",[201,856,857,858,861],{},"Add a suffix after the field to start another set of variables for the same forge. Every variable in a set has the same suffix, and ",[204,859,860],{},"entry.suffix"," holds it:",[236,863,867],{"className":864,"code":865,"language":866,"meta":241,"style":241},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","FORGES_GITHUB_TOKEN=ghp_...\nFORGES_GITHUB_TOKEN_WORK=ghp_...\nFORGES_GITHUB_BASE_URL_WORK=https:\u002F\u002Fghe.example.com\u002Fapi\u002Fv3\n","sh",[204,868,869,874,879],{"__ignoreMap":241},[245,870,871],{"class":247,"line":248},[245,872,873],{},"FORGES_GITHUB_TOKEN=ghp_...\n",[245,875,876],{"class":247,"line":278},[245,877,878],{},"FORGES_GITHUB_TOKEN_WORK=ghp_...\n",[245,880,881],{"class":247,"line":285},[245,882,883],{},"FORGES_GITHUB_BASE_URL_WORK=https:\u002F\u002Fghe.example.com\u002Fapi\u002Fv3\n",[201,885,886,888,889,219],{},[204,887,233],{}," throws when two providers share a forge and an instance. If two sets point at the same host, give one of them a different ",[204,890,668],{},[892,893,894],"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":241,"searchDepth":278,"depth":278,"links":896},[897,898,899,900],{"id":223,"depth":278,"text":224},{"id":309,"depth":278,"text":310},{"id":574,"depth":278,"text":575},{"id":853,"depth":278,"text":854},"Create providers from FORGES_* environment variables.","md",null,{"icon":905},"i-lucide-settings",{"title":38,"description":901},"s9i7NwaqPPJjMU4AE8zsTbWgWqsbWo1R9SpqDcQLDpk",[909,911],{"title":34,"path":35,"stem":36,"description":910,"children":-1},"Register several providers and route calls by ref or by URL.",{"title":42,"path":43,"stem":44,"description":912,"children":-1},"Verify a delivery and turn it into normalised events.",1791294008068]