{"id":14978146,"url":"https://github.com/socketio/socket.io-postgres-adapter","last_synced_at":"2025-09-22T10:31:56.780Z","repository":{"id":45384217,"uuid":"376224953","full_name":"socketio/socket.io-postgres-adapter","owner":"socketio","description":"The Socket.IO Postgres adapter, allowing to broadcast events between several Socket.IO servers","archived":false,"fork":false,"pushed_at":"2024-07-17T23:47:41.000Z","size":635,"stargazers_count":24,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-07T03:45:00.552Z","etag":null,"topics":["postgres","postgresql","socket-io","websocket"],"latest_commit_sha":null,"homepage":"https://socket.io","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,"publiccode":null,"codemeta":null}},"created_at":"2021-06-12T07:04:12.000Z","updated_at":"2024-07-17T23:47:45.000Z","dependencies_parsed_at":"2024-09-18T23:05:02.031Z","dependency_job_id":null,"html_url":"https://github.com/socketio/socket.io-postgres-adapter","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":"0.16216216216216217","last_synced_commit":"d38fbda3f20c63e613fe573513a066bf03f0ce07"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-postgres-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-postgres-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-postgres-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-postgres-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketio","download_url":"https://codeload.github.com/socketio/socket.io-postgres-adapter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233841627,"owners_count":18738651,"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":["postgres","postgresql","socket-io","websocket"],"created_at":"2024-09-24T13:56:56.242Z","updated_at":"2025-09-22T10:31:51.463Z","avatar_url":"https://github.com/socketio.png","language":"TypeScript","readme":"# Socket.IO Postgres adapter\n\nThe `@socket.io/postgres-adapter` package allows broadcasting packets between multiple Socket.IO servers.\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./assets/adapter_dark.png\"\u003e\n  \u003cimg alt=\"Diagram of Socket.IO packets forwarded through PostgreSQL\" src=\"./assets/adapter.png\"\u003e\n\u003c/picture\u003e\n\n**Table of contents**\n\n- [Supported features](#supported-features)\n- [Installation](#installation)\n- [Usage](#usage)\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.3.0`) |\n| Connection state recovery       | `4.6.0`             | :x: NO                                         |\n\n## Installation\n\n```\nnpm install @socket.io/postgres-adapter\n```\n\n## Usage\n\n```js\nimport { Server } from \"socket.io\";\nimport { createAdapter } from \"@socket.io/postgres-adapter\";\nimport pg from \"pg\";\n\nconst io = new Server();\n\nconst pool = new pg.Pool({\n  user: \"postgres\",\n  host: \"localhost\",\n  database: \"postgres\",\n  password: \"changeit\",\n  port: 5432,\n});\n\npool.query(`\n  CREATE TABLE IF NOT EXISTS socket_io_attachments (\n      id          bigserial UNIQUE,\n      created_at  timestamptz DEFAULT NOW(),\n      payload     bytea\n  );\n`);\n\npool.on(\"error\", (err) =\u003e {\n  console.error(\"Postgres error\", err);\n});\n\nio.adapter(createAdapter(pool));\nio.listen(3000);\n```\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-postgres-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketio%2Fsocket.io-postgres-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-postgres-adapter/lists"}