FR: Support direct lookup of Storage objects by `metadata.id`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- google-cloud, node.js, typescript
Research direction
Start with the Admin SDK's Bucket class and trace how it creates file references; compare that path with the underlying @google-cloud/storage client mentioned in the issue. Define how a metadata.id lookup would be supported, then verify that the returned object supports getMetadata(), download(), and getSignedUrl() like bucket.file(path).
Written by the indexing model from the issue text.
Description
Title:
FR: Support direct lookup of Storage objects by metadata.id
Is your feature request related to a problem? Please describe.
Currently in the Admin SDK there is no way to fetch a file reference directly by its internal metadata.id. Users must call bucket.getFiles() (optionally with a prefix) and then iterate through every file’s metadata until they find a match. This approach is painfully inefficient for buckets with hundreds or thousands of objects, and leads to high latency and extra egress charges just to resolve a single file by its ID.
Describe the solution you’d like
Add a first-class API—e.g.
const file = await bucket.fileById('ABCD1234-xyz');
under the Admin SDK’s Bucket class (and optionally in the underlying @google-cloud/storage client). Internally it could leverage a server-side lookup or index rather than requiring a full listing scan. The returned object should behave identically to bucket.file(path) so you can immediately call getMetadata(), download(), or getSignedUrl().
Describe alternatives you’ve considered
-
Client-side scan:
const [files] = await bucket.getFiles(); for (const f of files) { const [m] = await f.getMetadata(); if (m.id === targetId) return f; }
Works, but requires listing every object + extra round-trips.
- Storing custom metadata: You could save your own “id” in
metadata.customand index it in Firestore, but that duplicates what the server already knows, and still needs a separate database lookup.
Additional context
- This feature is especially important for multi-tenant or large-scale apps where buckets routinely hit thousands of files.
- Without it, reverse-lookup patterns become a maintenance burden and performance bottleneck.
- Screenshot of current workaround and templates attached.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 419
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 16
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-admin-node
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 comments · 1 assignee ·
-
api: messaging
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Difficulty 5/5 Over a week Newbie friendliness 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 comment · 1 assignee ·
All issues in firebase/firebase-admin-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/claude-code#96687 ·
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
AOSSIE-Org/DebateAI#582 · 2 comments ·