{"id":16233571,"url":"https://github.com/fre5h/centrifugobundle","last_synced_at":"2025-04-07T05:15:00.964Z","repository":{"id":38308574,"uuid":"164834807","full_name":"fre5h/CentrifugoBundle","owner":"fre5h","description":"📦 Provides communication with web-socket server Centrifugo in Symfony applications.","archived":false,"fork":false,"pushed_at":"2024-07-03T19:53:27.000Z","size":1742,"stargazers_count":76,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-07T10:23:08.529Z","etag":null,"topics":["bundle","centrifugo","centrifugo-bundle","real-time","socket","symfony","web-socket","websocket"],"latest_commit_sha":null,"homepage":"https://centrifugal.github.io/centrifugo/","language":"PHP","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/fre5h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fre5h"}},"created_at":"2019-01-09T09:47:23.000Z","updated_at":"2024-07-26T15:07:18.000Z","dependencies_parsed_at":"2023-11-20T10:31:07.474Z","dependency_job_id":"de872059-514b-4950-a708-16a842df2268","html_url":"https://github.com/fre5h/CentrifugoBundle","commit_stats":{"total_commits":52,"total_committers":3,"mean_commits":"17.333333333333332","dds":0.05769230769230771,"last_synced_commit":"cee50eb0bf7be016b63ccd7ed12a3177708e9c2b"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FCentrifugoBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FCentrifugoBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FCentrifugoBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fre5h%2FCentrifugoBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fre5h","download_url":"https://codeload.github.com/fre5h/CentrifugoBundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"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":["bundle","centrifugo","centrifugo-bundle","real-time","socket","symfony","web-socket","websocket"],"created_at":"2024-10-10T13:13:07.094Z","updated_at":"2025-04-07T05:15:00.940Z","avatar_url":"https://github.com/fre5h.png","language":"PHP","funding_links":["https://github.com/sponsors/fre5h"],"categories":[],"sub_categories":[],"readme":"# CentrifugoBundle\n\n📦 Provides communication with web-socket server [Centrifugo](https://centrifugal.dev) in [Symfony](https://symfony.com) applications.\n\n[![Scrutinizer Quality Score](https://img.shields.io/scrutinizer/g/fre5h/CentrifugoBundle.svg?style=flat-square)](https://scrutinizer-ci.com/g/fre5h/CentrifugoBundle/)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/fre5h/CentrifugoBundle/ci.yaml?branch=main\u0026style=flat-square)](https://github.com/fre5h/CentrifugoBundle/actions?query=workflow%3ACI+branch%3Amain+)\n[![CodeCov](https://img.shields.io/codecov/c/github/fre5h/CentrifugoBundle.svg?style=flat-square)](https://codecov.io/github/fre5h/CentrifugoBundle)\n[![License](https://img.shields.io/packagist/l/fresh/centrifugo-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/centrifugo-bundle)\n[![Latest Stable Version](https://img.shields.io/packagist/v/fresh/centrifugo-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/centrifugo-bundle)\n[![Total Downloads](https://img.shields.io/packagist/dt/fresh/centrifugo-bundle.svg?style=flat-square)](https://packagist.org/packages/fresh/centrifugo-bundle)\n[![StyleCI](https://styleci.io/repos/164834807/shield?style=flat-square)](https://styleci.io/repos/164834807)\n[![Gitter](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/fre5h/CentrifugoBundle)\n\n## Features 🎁\n\n- [x] Compatible with latest [Centrifugo 5.4.7](https://github.com/centrifugal/centrifugo/releases/tag/v5.4.7) 🚀\n- [x] Wrapper over [Centrifugo HTTP API](https://centrifugal.dev/docs/server/server_api#http-api) 🔌\n- [X] Authentication with JWT token (HMAC algorithm) for [anonymous](./Resources/docs/authentication.md#anonymous), [authenticated user](./Resources/docs/authentication.md#authenticated-user) and [private channel](./Resources/docs/authentication.md#private-channel) 🗝️\n- [x] [Batch request](./Resources/docs/centrifugo_service_methods.md#batch-request) in [JSON streaming format](https://en.wikipedia.org/wiki/JSON_streaming) 💪\n- [x] [Console commands](./Resources/docs/console_commands.md \"Console commands\") ⚒️️\n- [x] Integration into Symfony Web-Profiler 🎛️\n\n## Requirements 🧐\n\n* PHP \u003e= 8.3\n* Symfony 7.0\n\n## Installation 🌱\n\n```bash\n$ composer req fresh/centrifugo-bundle\n```\n\n##### Choose the version you need\n\n| Bundle Version (X.Y.Z) |   PHP    | Symfony |       Comment       |\n|:----------------------:|:--------:|:-------:|:--------------------|\n|        `6.2.*`         | `\u003e= 8.3` | `7.*`   | **Current version** |\n|        `5.3.*`         | `\u003e= 8.2` | `7.*`   | Previous version    |\n\nBy default, [Symfony Flex](https://symfony.com/doc/current/setup/flex.html) adds this bundle to the `config/bundles.php` file and adds required environment variables into `.env` file.\nIn case when you ignored `contrib-recipe` during bundle installation it would not be done. Then you have to do this manually.\n\n#### Check the `config/bundles.php` file\n\n```php\n# config/bundles.php\n\nreturn [\n    // Other bundles...\n    Fresh\\CentrifugoBundle\\FreshCentrifugoBundle::class =\u003e ['all' =\u003e true],\n    // Other bundles...\n];\n```\n\n#### Check the `.env` file and add you configuration\n\n```yaml\n# .env\n\n###\u003e fresh/centrifugo-bundle ###\nCENTRIFUGO_API_KEY=secret-api-key\nCENTRIFUGO_API_ENDPOINT=http://localhost:8000/api\nCENTRIFUGO_SECRET=secret\n###\u003c fresh/centrifugo-bundle ###\n```\n\n`CENTRIFUGO_API_KEY` should be the same value as option `api_key` in your Centrifugo config file.  \n`CENTRIFUGO_SECRET` should be the same value as option `token_hmac_secret_key` in your Centrifugo config file.\n\nℹ️ [Customize bundle configuration](./Resources/docs/configuration.md \"Customize bundle configuration\")\n\n## Using 🧑‍🎓\n\n### Centrifugo service\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nnamespace App\\Service;\n\nuse Fresh\\CentrifugoBundle\\Service\\CentrifugoInterface;\n\nclass YourService\n{\n    public function __construct(private readonly CentrifugoInterface $centrifugo)\n    {\n    }\n\n    public function example(): void\n    {\n        $this-\u003ecentrifugo-\u003epublish(['foo' =\u003e 'bar'], 'channelName');\n    }\n}\n```\n\nℹ️ [More examples of using Centrifugo service](./Resources/docs/centrifugo_service_methods.md \"More examples of using Centrifugo service\")\n\n### Authentication with JWT tokens 🗝️\n\n* [For anonymous](./Resources/docs/authentication.md#anonymous)\n* [For authenticated User](./Resources/docs/authentication.md#authenticated-user)\n* [For private channel](./Resources/docs/authentication.md#private-channel) \n\n### Console commands ⚒️\n\n* `centrifugo:publish`\n* `centrifugo:broadcast`\n* `centrifugo:subscribe`\n* `centrifugo:unsubscribe`\n* `centrifugo:disconnect`\n* `centrifugo:refresh`\n* `centrifugo:presence`\n* `centrifugo:presence-stats`\n* `centrifugo:history`\n* `centrifugo:history-remove`\n* `centrifugo:channels`\n* `centrifugo:info`\n\nℹ️ [More examples of using console commands](./Resources/docs/console_commands.md \"More examples of using console commands\")\n\n### Integration into Symfony Web-Profiler 🎛️\n\n![](./Resources/images/profiler_example.png \"Profiler example\")\n\n### Autocomplete channels in console commands 🪄\n\n![](./Resources/images/autocomplete_example.gif)\n\n## Contributing 🤝\n\nRead the [CONTRIBUTING](https://github.com/fre5h/CentrifugoBundle/blob/master/.github/CONTRIBUTING.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffre5h%2Fcentrifugobundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffre5h%2Fcentrifugobundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffre5h%2Fcentrifugobundle/lists"}