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/MemoryQueuewith 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/corefor theStore,Binary, andQueuebase classes;@webda/asyncfor job orchestration on top of GCPQueue;@webda/awsfor the AWS equivalent.
Classes
- FireStore
- FireStoreParameters
- FireStoreRepository
- GCPPubSubParameters
- GCPPubSubService
- GCPQueue
- GCPQueueParameters
- GCSFinder
- Storage
- StorageParameters
Interfaces
Type Aliases
- DownloadParams
- FireStoreIndex
- FireStoreIndexOrder
- PutObjectParams
- SignedUrlParams
- StorageObject
- StorageObjectMeta