{"id":19639553,"url":"https://github.com/cognitev/pubsub-gcp-js","last_synced_at":"2026-05-17T09:41:12.604Z","repository":{"id":38764477,"uuid":"273000723","full_name":"cognitev/pubsub-gcp-js","owner":"cognitev","description":"a wrapping package around GCP pubsub package to provide a more convenient, abstract functionalities","archived":false,"fork":false,"pushed_at":"2022-06-02T22:07:46.000Z","size":156,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T23:18:01.161Z","etag":null,"topics":["events","gcp","javascript","nodejs","pubsub"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cognitev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-17T14:47:06.000Z","updated_at":"2020-09-02T21:40:36.000Z","dependencies_parsed_at":"2022-09-21T03:51:40.198Z","dependency_job_id":null,"html_url":"https://github.com/cognitev/pubsub-gcp-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognitev%2Fpubsub-gcp-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognitev%2Fpubsub-gcp-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognitev%2Fpubsub-gcp-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cognitev%2Fpubsub-gcp-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cognitev","download_url":"https://codeload.github.com/cognitev/pubsub-gcp-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240943441,"owners_count":19882403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["events","gcp","javascript","nodejs","pubsub"],"created_at":"2024-11-11T13:02:03.027Z","updated_at":"2025-10-19T11:38:36.247Z","avatar_url":"https://github.com/cognitev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pubsub-gcp-js\n\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n[![Build Status:](https://github.com/cognitev//pubsub-gcp-js/workflows/Node/badge.svg)](https://github.com/cognitev/pubsub-gcp-js/actions)\n\nWrapping package around gcp pubsub package to provide a more conveniet, abstract functionalities\n\n## how to install\n\n```shell\nnpm i --save pubsub-gcp\n```\n\n## how to use\n\n- first step is to initialize pubsub client with your account credentialis\n\n```js\nconst pubsub = require('pubsub-gcp');\nconst privateKey = 'gcp_private_key';\nconst email = 'account_email';\nconst projectId = 'target_gcp_project';\nawait pubsub.initClient(projectId, email, privateKey);\n```\n\n here you have 3 params that you get from your account on GCP to authorize the package\n to publish messages on your behalf.\n\nNote: if you pass any of those params as `null` or did not pass any of them at all, they will replaced by the\nfollowing envs respectively:\n\n- `GCLOUD_PROJECT_ID_PUBSUB`\n- `GCLOUD_CLIENT_EMAIL`\n- `GCLOUD_PRIVATE_KEY`\n\n- to publish a message on any of your topics:\n\n```js\nawait pubsub.publish({'random': 'message'}, 't2'); // will return message id on topic\n```\n\nNote: you can pass a third argument `create_topic` as true to auto create the topic then publish the message\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcognitev%2Fpubsub-gcp-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcognitev%2Fpubsub-gcp-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcognitev%2Fpubsub-gcp-js/lists"}