Skip to main content

@swamp/gcs-datastore

v2026.04.28.4

Store data in a Google Cloud Storage bucket with local cache synchronization. Provides distributed locking via GCS generation-based preconditions and bidirectional sync between a local cache directory and GCS.

Authentication

Uses Google Cloud Application Default Credentials (ADC) — no credentials in config. Provide credentials via one of:

  • Environment variable: GOOGLE_APPLICATION_CREDENTIALS pointing to a service account key JSON file
  • User credentials: gcloud auth application-default login
  • Attached service account on GCE, Cloud Run, or GKE

Required IAM Permissions

  • storage.buckets.get
  • storage.objects.create
  • storage.objects.get
  • storage.objects.delete
  • storage.objects.list

The predefined role roles/storage.objectAdmin covers all of these.

Usage

swamp datastore setup @swamp/gcs-datastore \
  --config '{"bucket": "my-bucket", "prefix": "swamp"}' --json

Repository

https://github.com/systeminit/swamp-extensions

Labels

datastoregcpgcsstorage

Contents

Quality score

Verified by Swamp

How well-documented and verifiable this extension is.

91%

Grade A

  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types0/1missing
  • Has description1/1earned
  • At least one platform tag (or universal)1/1earned
  • Two or more platform tags (or universal)1/1earned
  • License declared1/1earned
  • Verified public repository2/2earned

Install

$ swamp extension pull @swamp/gcs-datastore

Google Cloud Storageconfigurable
@swamp/gcs-datastoregcs.ts

Store data in a Google Cloud Storage bucket with local cache synchronization.

Config Fields

FieldTypeDescription
bucketstringGCS bucket name
prefix?stringObject name prefix within the bucket
projectId?stringGCP project ID (defaults to ADC project)
apiEndpoint?stringCustom API endpoint URL (for emulators like fake-gcs-server)