Gets the service for the default app or a given app.getStorage() can be called with no arguments to access the default app's Storage service or as getStorage(app) to access the Storage service associated with a specific app.
// Get the downloadUrl for a given file refconststorage=getStorage();constmyRef=ref(storage,'images/mountains.jpg');constdownloadUrl=awaitgetDownloadURL(myRef);
getStorage(app)
Gets the service for the default app or a given app.
getStorage() can be called with no arguments to access the default app's Storage service or as getStorage(app) to access the Storage service associated with a specific app.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-12 UTC."],[],[],null,["Cloud Storage for Firebase.\n\nFunctions\n\nClasses\n\ngetDownloadURL(file)\n\nGets the download URL for the given [File](https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/file).\n\n**Signature:** \n\n export declare function getDownloadURL(file: File): Promise\u003cstring\u003e;\n\nParameters\n\n**Returns:**\n\nPromise\\\u003cstring\\\u003e\n\nExample \n\n // Get the downloadUrl for a given file ref\n const storage = getStorage();\n const myRef = ref(storage, 'images/mountains.jpg');\n const downloadUrl = await getDownloadURL(myRef);\n\ngetStorage(app)\n\nGets the service for the default app or a given app.\n\n`getStorage()` can be called with no arguments to access the default app's `Storage` service or as `getStorage(app)` to access the `Storage` service associated with a specific app.\n\n**Signature:** \n\n export declare function getStorage(app?: App): Storage;\n\nParameters\n\n**Returns:**\n\n[Storage](./firebase-admin.storage.storage_2.md#storage_2_class)\n\nExample 1 \n\n // Get the Storage service for the default app\n const defaultStorage = getStorage();\n\nExample 2 \n\n // Get the Storage service for a given app\n const otherStorage = getStorage(otherApp);"]]