Search by

firstlightui / chat-protocol

wojt-janowski

The wire contract for Firstlight Chat: HTTP endpoints, broadcast events and push payloads, with shared PHP DTOs and JSON fixtures.

Package info

github.com/firstlightui/chat-protocol

Homepage

pkg:composer/firstlightui/chat-protocol

Statistics

Installs: 4

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-28 09:23 UTC

This package is auto-updated.

Last update: 2026-11-28 20:13:42 UTC


README

The wire contract between a Firstlight Chat server and its mobile clients.

The controls that display a conversation, <firstlight:chat> and <firstlight:chat-composer>, are part of Firstlight and work with any backend. This protocol is one way to feed them.

PHP

composer require firstlightui/chat-protocol

Plain PHP 8.4, no framework. Every object, request, response, broadcast and push has a readonly class under FirstlightUI\ChatProtocol with fromArray(), which throws InvalidPayload naming the field that breaks the spec, and toArray(), which writes exactly the fixture's shape. Receipts::status() and Receipts::readBy() apply the spec's delivery-status rule, and ChatPush::fromNotificationData() reads the chat object from an APNs or FCM payload.

Version 1 is a draft.

License

MIT. See LICENSE.