Problem:
The Chat Quickstart guide currently only provides solutions using Vite and Node.js (JavaScript runtime), not other frameworks such as Angular. For reference, similar projects like Angular ( PHP ) cannot utilize NodeJS package installer, blocking the development progress.
Solution:
Agora Chat have two methods of implementation. The first method uses the Chat SDK ( Client SDK ) and the other one using the RESTful API with the provided Agora Chat endpoints per Chat function.
The RESTful API method can be integrated on projects like Angular ( PHP ) which effectively utilizes PHP's capability to send HTTP methods ( POST, GET, etc. ) without the need of Chat SDK installation.
The recommended implementation should use an intermediate server or middleware to bridge the PHP client and Agora Chat Server, securing any sensitive credentials that can be exposed into the public.
Example: ( sending a text message )
User Client ( Angular ) <=> Your ( PHP ) server <=> Agora Chat Server
Message Flow Breakdown
-
Client Submission
-
A user client sends a message (single recipient) to your server
-
Raw message data (e.g., JSON/Form-encoded)
-
-
Server Processing
-
Your server:
a. Validates the message
b. Transforms it into Agora's required payload format
c. Sets conversation mode to 1:1 chat -
Reference: Follow Agora's [Send Message API] guide
-
-
Agora API Request
-
Your server POSTs the formatted payload to:
POST https://{host}/{org_name}/{app_name}/messages/users
-
Headers: Include auth tokens ( Bearer $appToken )
-
-
Agora Response Handling
-
Success: Agora responds with
200 OK
+ message metadata -
Error: Agora returns 4xx/5xx with error details
-
-
Client Notification
-
Your server relays Agora's response to the user client:
-
Success: Confirm delivery + message ID/timestamp
-
Error: Forward status code + retry guidance
-
-