Download the PHP package webpatser/resonate-webhooks without Composer

On this page you can find all versions of the php package webpatser/resonate-webhooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package resonate-webhooks

Resonate Webhooks

Pusher-style HTTP webhooks for Resonate. It POSTs channel_occupied, channel_vacated, member_added, member_removed, and client_event to your backend, so your application reacts to channel activity without polling the socket server.

The problem it solves

Reverb fires Pusher webhooks; Resonate fires none. A backend that needs to know "this room just emptied", "a user joined", or "someone whispered a client event" has no push signal, so it polls or stands up its own metrics round-trip.

Two things make naive webhooks wrong on a scaled cluster:

  1. Occupancy is per node. Resonate's ChannelCreated/ChannelRemoved events fire on each node independently. Firing channel_occupied from them double-sends it when a channel has subscribers on two nodes, and fires channel_vacated from one node while another still holds subscribers.
  2. Presence is per node. The same user can be present on two nodes; a node firing member_removed for its own last connection is wrong if the user is still on another node.

This package fixes both by reading occupancy from webpatser/resonate-roster, which keeps a cluster-wide, self-healing membership count, and claiming each edge exactly once per cluster.

How it works

Edges, not state

The roster answers "how many connections does channel C have" and "which users are in C", cluster-wide. A webhook is an edge: the transition into or out of those states. The plugin derives edges like this:

Because the flag is the arbiter, each edge fires exactly once per cluster even when several nodes see the transition at the same instant.

Delivery, off the connection path

Connection hooks only buffer events; they never make HTTP calls. A delivery tick coalesces the buffer into one POST per endpoint and sends each in a detached fiber, so a slow endpoint never stalls the event loop. A failed delivery is retried with exponential backoff and dropped after max_attempts. Delivery is in-process: undelivered webhooks are lost if the server process crashes.

Plugin ordering

RedisRosterPlugin must be listed before WebhookPlugin in config/reverb.php. Resonate runs plugin hooks sequentially in array order within one fiber, so the roster's Redis writes land before this plugin reads the cluster count.

Installation

This pulls in webpatser/resonate-roster. Publish both configs if you want to change defaults:

Configuration

1. Let the roster track all channels

Webhooks need occupancy for every channel type, not just presence channels. Set the roster's track mode to all:

2. Register both plugins, roster first

3. Declare your endpoints

Restart Resonate (php artisan resonate:start, or resonate:reload for a zero-downtime swap).

The webhook request

Each delivery is a Pusher-format POST, signed so the receiver can verify it:

The key and secret come from the matching app in reverb.apps, so a Pusher webhook consumer verifies it with no changes. Verify the signature before trusting the body:

Configuration reference

Key Default Purpose
connection REDIS_* env Redis server. Must be the same server and database as resonate-roster.
key_prefix wh Namespace for the edge-detection flag keys.
ttl 90 Flag-key TTL in seconds, so a dead node's flag self-heals.
flush_interval 1.0 Seconds between delivery ticks; events in that window are coalesced.
reconcile_interval 30.0 Seconds between occupancy reconcile ticks.
max_attempts 5 Delivery attempts before a webhook is dropped.
endpoints [] The endpoints that receive webhooks.

Notes and caveats

Requirements

Testing

Tests that touch Redis expect a server on 127.0.0.1:6379 and use database 15; they skip cleanly when no Redis is reachable.

License

MIT. See LICENSE.


All versions of resonate-webhooks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
illuminate/contracts Version ^13.0
illuminate/support Version ^13.0
webpatser/fledge-fiber Version ^13.4
webpatser/resonate Version ^0.4
webpatser/resonate-roster Version ^0.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webpatser/resonate-webhooks contains the following files

Loading the files please wait ...