> Documentation index: https://firebase.google.com/docs/reference/admin/node/llms.txt

Cloud Storage for Firebase.

## Functions

| Function | Description |
|---|---|
| [getDownloadURL(file)](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.md.txt#getdownloadurl_bc488a6) | Gets the download URL for the given [File](https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/file). |
| [getStorage(app)](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.md.txt#getstorage_8a40afc) | Gets the [Storage](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.storage.md.txt#storage_class) 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. |

## Classes

| Class | Description |
|---|---|
| [FirebaseStorageError](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.firebasestorageerror.md.txt#firebasestorageerror_class) | Firebase Storage error code structure. This extends `FirebaseError`. |
| [Storage](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.storage.md.txt#storage_class) | The default `Storage` service if no app is provided or the `Storage` service associated with the provided app. |

## Variables

| Variable | Description |
|---|---|
| [StorageErrorCode](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.md.txt#storageerrorcode) | The constant mapping for valid Storage client error codes. |

## Type Aliases

| Type Alias | Description |
|---|---|
| [StorageErrorCode](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.md.txt#storageerrorcode) | The type definition for valid Storage client error codes. |

## getDownloadURL(file)

Gets the download URL for the given [File](https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/file).

**Signature:**

```typescript
export declare function getDownloadURL(file: File): Promise<string>;
```

### Parameters

| Parameter | Type | Description |
|---|---|---|
| file | File |   |

**Returns:**

Promise\<string\>

### Example

```javascript
// Get the downloadUrl for a given file ref
const storage = getStorage();
const myRef = ref(storage, 'images/mountains.jpg');
const downloadUrl = await getDownloadURL(myRef);

```

## getStorage(app)

Gets the [Storage](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.storage.md.txt#storage_class) 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.

**Signature:**

```typescript
export declare function getStorage(app?: App): Storage;
```

### Parameters

| Parameter | Type | Description |
|---|---|---|
| app | App |   |

**Returns:**

[Storage](https://firebase.google.com/docs/reference/admin/node/firebase-admin.storage.storage.md.txt#storage_class)

### Example 1

```javascript
// Get the Storage service for the default app
const defaultStorage = getStorage();

```

### Example 2

```javascript
// Get the Storage service for a given app
const otherStorage = getStorage(otherApp);

```

## StorageErrorCode

The constant mapping for valid Storage client error codes.

**Signature:**

```typescript
StorageErrorCode: {
    readonly INVALID_ARGUMENT: "invalid-argument";
    readonly INVALID_EMULATOR_HOST: "invalid-emulator-host";
    readonly MISSING_DEPENDENCIES: "missing-dependencies";
    readonly INVALID_CREDENTIAL: "invalid-credential";
    readonly NO_DOWNLOAD_TOKEN: "no-download-token";
}
```

## StorageErrorCode

The type definition for valid Storage client error codes.

**Signature:**

```typescript
export type StorageErrorCode = typeof StorageErrorCode[keyof typeof StorageErrorCode];
```