firebase / firebase/firebase-admin-node
[FR] Let specify function region: `getFunctions(undefined, 'southamerica-east1')`
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 16
Description
**Is your feature request related to a problem? Please describe.**
Not applicable.
**Describe the solution you'd like**
I need to specify the region of the function that I'm calling when enqueuing a task with `firebase-admin`:
```js
await getFunctions().taskQueue('foo').enqueue({
id: '123',
})
```
**Describe alternatives you've considered**
None.
EDIT: Just found that it's possible to specify the region like the following snippet, but maybe still consider adding the region parameter to `getFunctions()` to make it similar to the JS SDK (as also suggested [here](https://github.com/firebase/firebase-admin-node/issues/1704#issuecomment-1127970126)) or at least mention this in the docs:
```js
await getFunctions().taskQueue('locations/southamerica-east1/functions/foo').enqueue({
id: '123',
})
```
**Additional context**
Firebase JS SDK works that way. You can pass the region as the second argument to `getFunctions()`: https://firebase.google.com/docs/reference/js/functions.md#getfunctions
Contributor guide
Research direction
Begin at the getFunctions and taskQueue entry points, then inspect existing tests and documentation for region handling. Compare the Firebase JS SDK getFunctions signature with the Admin Node.js API; done means either the requested region parameter is supported with coverage, or the documented workaround is made clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, typescript
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100