PHPackages                             clayfreeman/twitch-eventsub-relay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. clayfreeman/twitch-eventsub-relay

ActiveLibrary[CLI &amp; Console](/categories/cli)

clayfreeman/twitch-eventsub-relay
=================================

Provides a CLI application that listens for Twitch EventSub webhook callbacks and relays them to connected TCP clients using a custom protocol.

1.0.5(1y ago)049MITPHPPHP &gt;=8.1

Since Mar 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/clayfreeman/twitch-eventsub-relay)[ Packagist](https://packagist.org/packages/clayfreeman/twitch-eventsub-relay)[ RSS](/packages/clayfreeman-twitch-eventsub-relay/feed)WikiDiscussions 1.0.x Synced today

READMEChangelogDependencies (4)Versions (10)Used By (0)

Twitch EventSub Relay
=====================

[](#twitch-eventsub-relay)

Twitch EventSub Relay is a command-line application that listens for Twitch EventSub webhook callbacks and relays them to connected TCP clients using a custom protocol.

Features
--------

[](#features)

- Listens for Twitch EventSub webhook callbacks over HTTP
- Relays events to connected clients over a persistent TCP connection
- Supports configurable HTTP and relay server ports
- Periodically checks connection health with a configurable keepalive interval

Requirements
------------

[](#requirements)

- PHP 8.1 or greater
- [Composer](https://getcomposer.org/)
- A reverse proxy to handle TLS termination

Installation
------------

[](#installation)

Begin by installing this package using Composer:

```
composer require clayfreeman/twitch-eventsub-relay
```

Finally, set up the application to run as a system service, then configure a reverse proxy for HTTPS traffic.

This application listens on all addresses, so a firewall may be advisable.

Usage
-----

[](#usage)

```
twitch-eventsub-relay [options] [--]
twitch-eventsub-relay-client   [timeout]
twitch-eventsub-relay-dispatcher    [timeout]
```

### Server

[](#server)

#### Arguments

[](#arguments)

ArgumentDescription`secret`The secret used to verify incoming notifications#### Options

[](#options)

OptionDescriptionDefault`--http-port`The port on which the HTTP server should listen`8000``--relay-port`The port on which the relay server should listen`8100``--ping-interval`The amount of time in seconds before sending a `PING` command to relay connections, and to close connections without a response`30`### Client

[](#client)

The client can be used to connect to a relay server, respond to `PING` commands, decode relayed payloads, and handle connection timeouts automatically. It is recommended to pipe the output of the client to something which is capable of decoding and processing JSON data (e.g., `jq`).

#### Arguments

[](#arguments-1)

ArgumentDescription`host`The hostname or IP address of the relay server`port`The port of the relay server`timeout`The timeout duration in seconds (should be double that of the server's `--ping-interval` value; optional; default=60)### Dispatcher

[](#dispatcher)

The dispatcher leverages the relay client to listen for data, passing it to standard input for each executable file in the specified directory.

#### Arguments

[](#arguments-2)

ArgumentDescription`dropins`The directory containing the executable files to run when data is received`host`The hostname or IP address of the relay server`port`The port of the relay server`timeout`The timeout duration in seconds (should be double that of the server's `--ping-interval` value; optional; default=60)Protocol
--------

[](#protocol)

The relay protocol is command-based, with each command on its own line terminated by a line feed (`\n`).

During the lifetime of a client connection, the server may send the following commands:

- `PING`: Sent periodically to check that the client connection is still active.
- `RELAY `: Used to relay Twitch EventSub notifications, where `` is base64-encoded JSON.

The client **MUST** respond to each `PING` command with a `PONG` command. Aside from responding to `PING` commands, the client **MUST NOT** send any data to the server.

If no data is received from the server within a configurable timeout interval, the client **SHOULD** terminate the connection and attempt to reconnect.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance43

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

10

Last Release

457d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/182658?v=4)[Clay Freeman](/maintainers/clayfreeman)[@clayfreeman](https://github.com/clayfreeman)

---

Top Contributors

[![clayfreeman](https://avatars.githubusercontent.com/u/182658?v=4)](https://github.com/clayfreeman "clayfreeman (9 commits)")

### Embed Badge

![Health badge](/badges/clayfreeman-twitch-eventsub-relay/health.svg)

```
[![Health](https://phpackages.com/badges/clayfreeman-twitch-eventsub-relay/health.svg)](https://phpackages.com/packages/clayfreeman-twitch-eventsub-relay)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M420](/packages/drupal-core-recommended)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
