Skip to main content
Community Maintained - This SDK is functional but receives limited maintenance. For production use, we recommend the TypeScript SDK or Python SDK.
Contributions welcome! See the GitHub repository to contribute.

Installation

Requirements

  • PHP 8.1+
  • Composer

Creating a Client

Or use the convenience function:

ClientOptions

Methods

createSession

Create a new session.

resumeSession

Resume an existing session by ID.

close

Close all sessions and disconnect.

run

Run the event loop (blocks until stopped).

stop

Stop the event loop.

getLoop

Get the ReactPHP event loop instance.

Event Handlers

Token Creation

Create tokens server-side for authentication:
Or use the array-based API:

Token Utilities

Full Example