Skip to content

Overview

@saflib/vendors-gcs implements ObjectStore against Google Cloud Storage.

What this package provides

  • GcsObjectStore — upload, list, read, and delete with path traversal checks
  • createGcsObjectStore({ bucketName }) — factory; returns TestObjectStore when NODE_ENV=test
  • configureGcsClient(options) / getStorage() — shared GCS client; optional explicit credentials or Application Default Credentials

Integration

Wire createGcsObjectStore({ bucketName }) in production service bootstrap and pass the instance through service context (backup restore, file uploads, etc.).

Credentials:

  • Call configureGcsClient() with service-account options from your secret store, or
  • Rely on Application Default Credentials (GOOGLE_APPLICATION_CREDENTIALS or GCE/GKE metadata)

Local development typically uses DiskObjectStore via createObjectStore({ type: "disk", rootPath }).

Azure Blob Storage alternative: @saflib/vendors-azure.