---
title: Google Cloud Storage
description: Google Cloud Storage via the official @google-cloud/storage SDK. Application Default Credentials by default, resumable uploads when onProgress is passed.
related:
  - /guides/gcs-signed-urls-without-service-account-key
  - /guides/sveltekit-file-upload
---

## Installation

`@google-cloud/storage` is an optional peer dependency of `files-sdk` - install alongside the SDK so the adapter's imports resolve at runtime.

```package-install
files-sdk @google-cloud/storage
```

## Usage

```ts lineNumbers
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](/docs/api/upload#progress-tracking) 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

<AutoTypeTable
  path="../../packages/files-sdk/src/gcs/index.ts"
  name="GCSAdapterOptions"
/>

## Compatibility

| Method | Status | Notes |
| --- | :-: | --- |
| `upload` | ✅ |  |
| `download` | ✅ |  |
| `delete` | ✅ |  |
| `list` | ✅ |  |
| `search` | ✅ |  |
| `head` | ✅ |  |
| `exists` | ✅ |  |
| `copy` | ✅ |  |
| `url` | ✅ | V4 signed URL, or your `publicBaseUrl` (no expiry). V4 signing caps `expiresIn` at 7 days (604800 seconds), so a longer one (or `defaultUrlExpiresIn`) throws `Invalid` before any request; `capabilities.signedUrl.maxExpiresIn` reports the cap, and the gateway clamps to it. |
| `signedUploadUrl` | ✅ | V4 signed PUT URL, or a V4 POST policy when `maxSize` is set - same 7-day `expiresIn` cap. |
