Google Cloud Storage
Google Cloud Storage via the official @google-cloud/storage SDK. Application Default Credentials by default.
Installation
@google-cloud/storage is an optional peer dependency of files-sdk - install alongside the SDK so the adapter's imports resolve at runtime.
npm install files-sdk @google-cloud/storageUsage
import { Files } from "files-sdk";
import { gcs } from "files-sdk/gcs";
const files = new Files({
adapter: gcs({
bucket: "uploads",
// No credentials needed in most setups - the @google-cloud/storage
// SDK auto-discovers Application Default Credentials from
// GOOGLE_APPLICATION_CREDENTIALS, gcloud auth, or the runtime
// service account on Cloud Run / GKE / GCE.
}),
});upload reports true byte-level progress via onProgress. Uploads default to a single simple request; when onProgress is passed, the adapter switches to a resumable upload (the only path that emits progress), which adds one round trip.
Options
Prop
Type
Compatibility
| Method | Status | Notes |
|---|---|---|
upload | ✅ | |
download | ✅ | |
delete | ✅ | |
list | ✅ | |
search | ✅ | |
head | ✅ | |
exists | ✅ | |
copy | ✅ | |
url | ✅ | |
signedUploadUrl | ✅ |
Firebase Storage
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.
Google Drive
Google Drive via the official Drive v3 client. Maps unified string keys onto Drive's appProperties with a per-instance LRU cache.