{"id":37701782,"url":"https://github.com/GetStream/stream-chat-php","last_synced_at":"2026-01-23T23:00:46.275Z","repository":{"id":34908901,"uuid":"184381746","full_name":"GetStream/stream-chat-php","owner":"GetStream","description":"Stream Chat official PHP API Client","archived":false,"fork":false,"pushed_at":"2026-01-12T15:42:59.000Z","size":273,"stargazers_count":30,"open_issues_count":6,"forks_count":9,"subscribers_count":29,"default_branch":"main","last_synced_at":"2026-01-12T21:40:01.909Z","etag":null,"topics":["chat","chat-api","php","rest"],"latest_commit_sha":null,"homepage":"https://getstream.io/chat/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GetStream.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-01T07:15:03.000Z","updated_at":"2025-12-22T11:57:05.000Z","dependencies_parsed_at":"2024-03-01T13:41:11.496Z","dependency_job_id":"9839275f-6646-4bcb-8743-1b7227caa000","html_url":"https://github.com/GetStream/stream-chat-php","commit_stats":{"total_commits":156,"total_committers":22,"mean_commits":7.090909090909091,"dds":0.75,"last_synced_commit":"2aaca2390676427ef658acdaefb333677420399c"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/GetStream/stream-chat-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GetStream","download_url":"https://codeload.github.com/GetStream/stream-chat-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28702893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chat","chat-api","php","rest"],"created_at":"2026-01-16T13:00:26.529Z","updated_at":"2026-01-23T23:00:46.267Z","avatar_url":"https://github.com/GetStream.png","language":"PHP","readme":"# Official PHP SDK for [Stream Chat](https://getstream.io/chat/)\n\n[![build](https://github.com/GetStream/stream-chat-php/workflows/build/badge.svg)](https://github.com/GetStream/stream-chat-php/actions) [![Latest Stable Version](https://poser.pugx.org/get-stream/stream-chat/v/stable)](https://packagist.org/packages/get-stream/stream-chat)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./assets/logo.svg\" width=\"50%\" height=\"50%\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    Official PHP API client for Stream Chat, a service for building chat applications.\n    \u003cbr /\u003e\n    \u003ca href=\"https://getstream.io/chat/docs/\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/GetStream/stream-chat-php/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/GetStream/stream-chat-php/issues\"\u003eRequest Feature\u003c/a\u003e\n\u003c/p\u003e\n\n## 📝 About Stream\n\nYou can sign up for a Stream account at our [Get Started](https://getstream.io/chat/get_started/) page.\n\nYou can use this library to access chat API endpoints server-side.\n\nFor the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries ([docs](https://getstream.io/chat/)).\n\n## ⚙️ Installation\n\n```shell\n$ composer require get-stream/stream-chat\n```\n\n## ✨ Getting started\n\n```php\nrequire_once \"./vendor/autoload.php\";\n```\n\nInstantiate a new client, find your API keys in the dashboard.\n\n```php\n$client = new GetStream\\StreamChat\\Client(\"\u003capi-key\u003e\", \"\u003capi-secret\u003e\");\n```\n\n### Generate a token for client-side usage\n\n```php\n$token = $client-\u003ecreateToken(\"bob-1\");\n\n// with an expiration time\n$expiration = (new DateTime())-\u003egetTimestamp() + 3600;\n$token = $client-\u003ecreateToken(\"bob-1\", $expiration);\n```\n\n### Update / Create users\n\n```php\n$bob = [\n    'id' =\u003e 'bob-1',\n    'role' =\u003e 'admin',\n    'name' =\u003e 'Robert Tables',\n];\n\n$bob = $client-\u003eupsertUser($bob);\n\n// Batch update is also supported\n$jane = ['id' =\u003e 'jane', 'role' =\u003e 'admin'];\n$june = ['id' =\u003e 'june', 'role' =\u003e 'user'];\n$tom = ['id' =\u003e 'tom', 'role' =\u003e 'guest'];\n$users = $client-\u003eupsertUsers([$jane, $june, $tom]);\n```\n\n### Channel types\n\n```php\n$channelConf = [\n    'name' =\u003e 'livechat',\n    'automod' =\u003e 'disabled',\n    'commands' =\u003e ['ban'],\n    'mutes' =\u003e true\n];\n\n$channelType = $client-\u003ecreateChannelType($channelConf);\n\n$allChannelTypes =  $client-\u003elistChannelTypes();\n```\n\n### Channels and messages\n\n```php\n$channel = $client-\u003eChannel(\"messaging\", \"bob-and-jane\");\n$state = $channel-\u003ecreate(\"bob-1\", ['bob-1', 'jane']);\n$channel-\u003eaddMembers(['mike', 'joe']);\n```\n### Messaging\n\n```php\n$msg_bob = $channel-\u003esendMessage([\"text\" =\u003e \"Hi June!\"], 'bob-1');\n\n// Reply to a message\n$reply_bob = $channel-\u003esendMessage([\"text\" =\u003e \"Long time no see!\"], 'bob-1', $msg_bob['message']['id']);\n```\n\n### Reactions\n```php\n$channel-\u003esendReaction($reply_bob['message']['id'], ['type' =\u003e 'like'], 'june');\n```\n\n### Moderation\n\n```php\n$channel-\u003eaddModerators(['june']);\n$channel-\u003edemoteModerators(['june']);\n\n$channel-\u003ebanUser('june', [\"reason\" =\u003e \"Being a big jerk\", \"timeout\" =\u003e 5, \"user_id\" =\u003e 'bob-1']);\n$channel-\u003eunbanUser('june', [\"user_id\" =\u003e 'bob-1']);\n```\n\n### Devices\n\n```php\n$device_id = \"iOS_Device_Token_123\";\n$client-\u003eaddDevice($device_id, \"apn\", \"june\");\n$devices = $client-\u003egetDevices('june');\n\n$client-\u003edeleteDevice($device_id, 'june');\n```\n\n## 🙋‍♀️ Frequently asked questions\n\n- **Q**: What date formats does the backend accept?\n- **A**: We accept [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) format. So you either use raw strings as date or you implement a serializer for your DateTime object.\n\n```php\nclass MyDateTime extends \\DateTime implements \\JsonSerializable\n{\n    public function jsonSerialize()\n    {\n        // Note: this returns ISO8601\n        // but it's compatible with 3339\n       return $this-\u003eformat(\"c\");\n    }\n}\n\n$createdAt = new MyDateTime();\n\n$client-\u003esearch( \n\t['type' =\u003e \"messaging\"], \n\t['created_at' =\u003e ['$lte' =\u003e $createdAt]], \n\t['limit' =\u003e 10]\n);\n```\n\n## ✍️ Contributing\n\nWe welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our [license file](./LICENSE) for more details.\n\nHead over to [CONTRIBUTING.md](./CONTRIBUTING.md) for some development tips.\n\n## 🧑‍💻 We are hiring!\n\nWe've recently closed a [$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing.\nOur APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.\n\nCheck out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).\n","funding_links":[],"categories":["Official SDKs \u0026 Tutorials"],"sub_categories":["Backend SDKs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGetStream%2Fstream-chat-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGetStream%2Fstream-chat-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGetStream%2Fstream-chat-php/lists"}