{"id":14978165,"url":"https://github.com/socketio/socket.io-gcp-pubsub-adapter","last_synced_at":"2025-03-25T12:33:07.747Z","repository":{"id":228588156,"uuid":"773954902","full_name":"socketio/socket.io-gcp-pubsub-adapter","owner":"socketio","description":"The Socket.IO adapter for Google Cloud pub/sub, allowing to broadcast events between several Socket.IO servers","archived":false,"fork":false,"pushed_at":"2024-03-19T13:54:57.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-20T08:22:40.546Z","etag":null,"topics":["gcp","gcp-pubsub","socketio"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@socket.io/gcp-pubsub-adapter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/socketio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-18T17:30:35.000Z","updated_at":"2025-02-13T22:20:09.000Z","dependencies_parsed_at":"2024-03-19T15:06:24.178Z","dependency_job_id":"0b104632-979f-44ea-8f7c-ca9aaab25c25","html_url":"https://github.com/socketio/socket.io-gcp-pubsub-adapter","commit_stats":null,"previous_names":["socketio/socket.io-gcp-pubsub-adapter"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-gcp-pubsub-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-gcp-pubsub-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-gcp-pubsub-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-gcp-pubsub-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketio","download_url":"https://codeload.github.com/socketio/socket.io-gcp-pubsub-adapter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245463005,"owners_count":20619594,"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":["gcp","gcp-pubsub","socketio"],"created_at":"2024-09-24T13:56:58.425Z","updated_at":"2025-03-25T12:33:07.122Z","avatar_url":"https://github.com/socketio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Socket.IO Google Cloud pub/sub adapter\n\nThe `@socket.io/gcp-pubsub-adapter` package allows broadcasting packets between multiple Socket.IO servers.\n\n**Table of contents**\n\n- [Supported features](#supported-features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Options](#options)\n- [License](#license)\n\n## Supported features\n\n| Feature                         | `socket.io` version | Support                                        |\n|---------------------------------|---------------------|------------------------------------------------|\n| Socket management               | `4.0.0`             | :white_check_mark: YES (since version `0.1.0`) |\n| Inter-server communication      | `4.1.0`             | :white_check_mark: YES (since version `0.1.0`) |\n| Broadcast with acknowledgements | `4.5.0`             | :white_check_mark: YES (since version `0.1.0`) |\n| Connection state recovery       | `4.6.0`             | :x: NO                                         |\n\n## Installation\n\n```\nnpm install @socket.io/gcp-pubsub-adapter\n```\n\n## Usage\n\n```js\nimport { PubSub } from \"@google-cloud/pubsub\";\nimport { Server } from \"socket.io\";\nimport { createAdapter } from \"@socket.io/gcp-pubsub-adapter\";\n\nconst pubsub = new PubSub({\n  projectId: \"your-project-id\"\n});\n\nconst topic = pubsub.topic(topicNameOrId);\n\nconst io = new Server({\n  adapter: createAdapter(topic)\n});\n\n// wait for the creation of the pub/sub subscription\nawait io.of(\"/\").adapter.init();\n\nio.listen(3000);\n```\n\n## Options\n\n| Name                  | Description                                                                                                       | Default value  |\n|-----------------------|-------------------------------------------------------------------------------------------------------------------|----------------|\n| `subscriptionPrefix`  | The prefix for the new subscription to create.                                                                    | `socket.io`    |\n| `subscriptionOptions` | The options used to create the subscription.                                                                      | `-`            |\n| `heartbeatInterval`   | The number of ms between two heartbeats.                                                                          | `5_000`        |\n| `heartbeatTimeout`    | The number of ms without heartbeat before we consider a node down.                                                | `10_000`       |\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-gcp-pubsub-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketio%2Fsocket.io-gcp-pubsub-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-gcp-pubsub-adapter/lists"}