Skip to main content

gcp

@webda/gcp

Google Cloud Platform integration bundle for Webda — Firestore Store, Cloud Storage Binary, Cloud Pub/Sub, GCP Queue, and KMS encryption service in one package.

When to use it​

  • You are deploying a Webda application on GCP and need cloud-native backing services.
  • You want to replace MemoryStore / FileBinary / MemoryQueue with GCP-managed equivalents for production.
  • You need envelope encryption via Google Cloud KMS for stored model data.

Install​

pnpm add @webda/gcp

What's inside​

  • FireStore — Firestore-backed Store for any Webda model (source)
  • Storage — Cloud Storage-backed Binary service for file uploads/downloads (source)
  • GCPQueue — Cloud Pub/Sub-backed Queue for reliable task delivery (source)
  • GCPPubSubService — Cloud Pub/Sub fan-out pub/sub messaging (source)
  • GCPKMSService — Cloud KMS-based encryption/decryption (source)

Quick config example​

{
"services": {
"userStore": {
"type": "FireStore",
"model": "MyApp/User",
"project": "my-gcp-project",
"collection": "users"
},
"uploads": {
"type": "Storage",
"bucket": "my-app-uploads"
},
"taskQueue": {
"type": "GCPQueue",
"topic": "my-app-tasks",
"subscription": "my-app-tasks-sub"
}
}
}

Authentication uses Application Default Credentials. Set GOOGLE_APPLICATION_CREDENTIALS to a service account key file for local development:

GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json webda serve

Reference​

  • API reference: see the auto-generated typedoc at docs/pages/Modules/gcp/.
  • Source: packages/gcp
  • Related: @webda/core for the Store, Binary, and Queue base classes; @webda/async for job orchestration on top of GCPQueue; @webda/aws for the AWS equivalent.

Classes​

Interfaces​

Type Aliases​

Functions​