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