Repository navigation
Conversation
…ion is set The README said the kit's functions deploy to us-central1 when no region is set. The Firebase CLI deploys them to us-east1. Document how to set the region with setGlobalOptions in a file imported before the kit, and add a test that the kit sets no region and follows global options.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the documentation to clarify that functions deploy to us-east1 by default unless a region is configured, and provides instructions on how to set the region using setGlobalOptions. It also adds a new test suite (region.test.ts) to verify region configuration behavior. The review feedback recommends adding an afterEach block to reset the global options in the tests to prevent test pollution and ensure proper isolation.
CorieW
commented
Oct 27, 2026
CorieW
commented
Oct 27, 2026
…ION_DEFAULT_REGION
CorieW
marked this pull request as ready for review
October 27, 2026 12:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrects the kit README, which said the functions deploy to
us-central1when no region is set. The Firebase CLI deploys them tous-east1. Fixes #3252. The kit still sets no region. Related: #3276 adds a similar note forsetGlobalOptions({ maxInstances }).Changes
us-east1unless you set a region. It recommends keeping them in the same region as the Firestore database and shows how to set the region: callsetGlobalOptions({ region })in its own file and import that file before the kit. A call in the entry file itself runs too late in an ES module, becauseimport/export … fromload the kit first. It also points tofirebase functions:kits:install/ext:migrate, which generate an entry file that setsregionfromFUNCTION_DEFAULT_REGION.tests/region.test.ts: the kit sets no region on its three functions, andsetGlobalOptions({ region })called before the kit loads applies to all three.Testing
On a test project, each instance with its own
nam5Firestore database, configFIRESTORE_PATHS=rec/{UID},FIRESTORE_DELETE_MODE=recursive, auto-discovery off:firebase/delete-user-data@0.1.30;kits@ 1c7b047, set up as the old README says (CommonJSindex.jsre-exporting the functions, no region);"type": "module"), withoptions.tssettingregion: "us-central1"and imported first byindex.ts.For each run I seeded
rec/<uid>plus 20,000 docs inrec/<uid>/items, created and deleted the Auth user, and counted what was left about 100s later.us-central1us-east1us-central1clearDatarecursive delete timeus-east1, about as fast as fromus-central1. I've updated the issue to say so.setGlobalOptionsin the same file left__endpoint.regionunset, and a separate options module set it to["us-central1"]. TypeScript compiled to CommonJS keeps the order, so the same-file call also works there.vitest run: 16 files, 121 tests pass. Prettier passes on the changed files (the README's existing tables already fail it).pnpm buildfails onkitswithTS2688: Cannot find type definition file for 'node'because@types/nodeisn't installed. That isn't caused by this change, andtscpasses with@types/nodeavailable.