{"id":21915524,"url":"https://github.com/feastframework/pusher","last_synced_at":"2025-10-08T07:17:29.992Z","repository":{"id":62503788,"uuid":"357772865","full_name":"FeastFramework/pusher","owner":"FeastFramework","description":"Plugin for working with Pusher","archived":false,"fork":false,"pushed_at":"2021-04-20T04:30:42.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-27T09:25:18.594Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FeastFramework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jpresutti"}},"created_at":"2021-04-14T04:26:52.000Z","updated_at":"2021-04-20T04:26:07.000Z","dependencies_parsed_at":"2022-11-02T10:01:31.716Z","dependency_job_id":null,"html_url":"https://github.com/FeastFramework/pusher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeastFramework%2Fpusher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeastFramework%2Fpusher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeastFramework%2Fpusher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FeastFramework%2Fpusher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FeastFramework","download_url":"https://codeload.github.com/FeastFramework/pusher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244935288,"owners_count":20534768,"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":[],"created_at":"2024-11-28T19:12:38.930Z","updated_at":"2025-10-08T07:17:24.948Z","avatar_url":"https://github.com/FeastFramework.png","language":"PHP","funding_links":["https://github.com/sponsors/jpresutti"],"categories":[],"sub_categories":[],"readme":"![FEAST Framework](https://github.com/FeastFramework/framework/blob/master/logos/feast-transparent-small.png?raw=true)\n\n![PHPUnit](https://github.com/FeastFramework/pusher/workflows/PHPUnit/badge.svg?branch=master)\n![Psalm Static analysis](https://github.com/FeastFramework/pusher/workflows/Psalm%20Static%20analysis/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/FeastFramework/pusher/branch/master/graph/badge.svg?token=IWFOXSdyRZ)](https://codecov.io/gh/FeastFramework/pusher)\n\n![PHP Version](https://img.shields.io/packagist/php-v/feast/json)\n[![Packagist](https://img.shields.io/packagist/v/feast/pusher)](https://packagist.org/packages/feast/pusher)\n![License](https://img.shields.io/github/license/FeastFramework/pusher.svg)\n[![Docs](https://img.shields.io/badge/docs-quickstart-green.svg)](https://docs.feast-framework.com)\n\n# FEAST Pusher Plugin\n\nThis package is a plug to work with [Pusher](https://pusher.com)\nfor [FEAST Framework](https://github.com/FeastFramework/framework)\n\n[Installation](#installation)\n\n[Usage](#configuration-and-usage)\n\n## Installation\n\nRecommended installation uses composer. This allows for quick setup.\n\n### Installing with Composer\n\nRun `composer install feast/pusher`.\n\nIn `container.php`, add the following at the bottom of the file.\n\n```php\n$container-\u003eadd(\\FeastFramework\\Pusher\\Pusher::class,new \\FeastFramework\\Pusher\\Pusher());\n```\n\n### Manual installation\n\nAlternatively, if you do not wish to use composer, this plugin can be manually installed by downloading and placed in a\nfolder of your choosing if you do not wish to use composer. You will need to add a path mapping in `container.php`\nbefore adding Pusher to the container. Replace `src` in the block below with the path to your installation of the Pusher\nplugin.\n\n```php\n/** @var \\Feast\\Autoloader $autoLoader */\n$autoLoader-\u003eaddPathMapping('FeastFramework\\\\Pusher', ['src']);\n$container-\u003eadd(\\FeastFramework\\Pusher\\Pusher::class,new \\FeastFramework\\Pusher\\Pusher());\n```\n\n## Configuration and Usage\n\n### Configuration\n\nThe Pusher plugin is configured by adding an array into your `configs/config.php` that contains the necessary keys. See\nsample below. Note that if you name your configuration namespace `pusher`, then you do not need to pass it in to the\nvarious methods.\n\n```php\n$environment['production'] = ['\n    pusher' =\u003e [\n        'cluster' =\u003e 'us2',\n        'key' =\u003e 'Your-App-Key',\n        'secret' =\u003e 'Your-Secret-Key',\n        'appid' =\u003e 'App-ID'\n    ]\n];\n```\n\n### Injection and Instantiation\n\nThe Pusher plugin can be automatically injected into both controllers and plugin classes by type-hinting the\nargument `\\FeastFramework\\Pusher\\Pusher`. To learn more about Dependency injection in FEAST, see the\ndocs, [here](https://docs.feast-framework.com/service-container.html#dependency-injection)\n\nAlternatively, you may directly instantiate by calling `new Pusher();`\n\n### Usage\n\nThe Pusher object has the following methods. All methods take various parameters as well as an optional configuration\nnamespace. Methods return objects that represent the data from the pusher API. See the `src/Response` folder for\ndetails.\n\n1. `getUsers` - get user information for a channel\n    1. Parameters\n        1. `channel`\n        2. `pusherConfigNamespace` - defaults to `pusher`\n2. `event` - Trigger a single event.\n    1. Parameters\n        1. `name` - The name of the event to trigger.\n        2. `data` - An array or stdClass of data to pass to the event.\n        3. `channels` - Either a single channel as a string, or an array of channels to publish to.\n        4. `socketId` - Exclude the event from the given socket id if passed in. Defaults to null.\n        5. `info` - An array of attributes which should be returned. Currently valid values are user_count and\n           subscription_count.\n        6. `pusherConfigNamespace` - defaults to `pusher`\n3. `batchEvents` - Trigger multiple events.\n    1. Parameters\n        1. `eventData` - See the\n           Pusher [docs](https://pusher.com/docs/channels/library_auth_reference/rest-api#post-batch-events-trigger-multiple-events-)\n           for more info.\n        2. `pusherConfigNamespace` - defaults to `pusher`\n4. `channelInfo` - Fetch information for a single channel.\n    1. Parameters\n        1. `channel` - Channel name to fetch information for\n        2. `infoType` - An array of attributes to fetch. Valid options are `user_count` and `subscription_count`.\n        3. `pusherConfigNamespace` - defaults to `pusher`\n5. `channelsInfo` - Fetch information for multiple channels\n    1. Parameters\n        1. `prefix` - Filter returned values by specified prefix. Defaults to null.\n        2. `infoType` - An array of attributes to fetch. Valid option currently only `user_count`.\n        3. `pusherConfigNamespace` - defaults to `pusher`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeastframework%2Fpusher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeastframework%2Fpusher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeastframework%2Fpusher/lists"}