---
title: Firebase Storage
description: Firebase Cloud Storage via the official firebase-admin SDK. Underlying client is @google-cloud/storage, so V4 signed URLs and POST policy uploads come for free.
peerDeps:
  - "firebase-admin"
---

## Installation

`firebase-admin` is an optional peer dependency of `files-sdk` - install alongside the SDK so the adapter's imports resolve at runtime.

```package-install
files-sdk firebase-admin
```

## Usage

Firebase Cloud Storage via the official `firebase-admin` SDK. The Admin SDK's `getStorage().bucket()` returns a `@google-cloud/storage` `Bucket` under the hood, so every primitive (server-side copy, V4 signed URLs, POST policy uploads) maps onto the GCS surface - with Firebase-flavoured credential conventions and a default bucket name derived from your project ID.

```ts lineNumbers
import { Files } from "files-sdk";
import { firebaseStorage } from "files-sdk/firebase-storage";

const files = new Files({
  adapter: firebaseStorage({
    bucket: "my-project.firebasestorage.app",
    // Auto-loads credentials from FIREBASE_PROJECT_ID,
    // FIREBASE_CLIENT_EMAIL, FIREBASE_PRIVATE_KEY, or falls back to
    // Application Default Credentials (GOOGLE_APPLICATION_CREDENTIALS,
    // gcloud auth, GCE metadata). Or pass an existing firebase-admin App
    // or @google-cloud/storage Bucket via `app`.
  }),
});
```

`upload` reports true byte-level [progress](/api/upload#progress-tracking) via `onProgress`. As with GCS, passing `onProgress` switches the upload to a **resumable** request (the only path that emits progress), which adds one round trip.

## Options

<AutoTypeTable
  path="../../packages/files-sdk/src/firebase-storage/index.ts"
  name="FirebaseStorageAdapterOptions"
/>

## Limitations

Firebase's `?alt=media&token=...` download-token URL form is out of scope for v1 - `url()` always returns either a V4 signed read URL or your configured `publicBaseUrl`. Reach for `adapter.raw` (the underlying `@google-cloud/storage` `Bucket`) if you need to mint Firebase download tokens or use any GCS-side feature that isn't in the unified API. Stream uploads use single-request mode; multi-GB resumable uploads also need `raw`.

## Compatibility

| Method            | Status | Notes |
| ----------------- | :----: | ----- |
| `upload`          |   ✅   |       |
| `download`        |   ✅   |       |
| `delete`          |   ✅   |       |
| `list`            |   ✅   |       |
| `search`          |   ✅   |       |
| `head`            |   ✅   |       |
| `exists`          |   ✅   |       |
| `copy`            |   ✅   |       |
| `url`             |   ✅   |       |
| `signedUploadUrl` |   ✅   |       |
