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)040MITPHPPHP &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 1mo ago

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

31

—

LowBetter than 68% of packages

Maintenance46

Moderate activity, may be stable

Popularity8

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

404d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23ac013c9e01441cfb5d67ed6cacc41a7d155f24f41bec16eb04ac10f8423d9f?d=identicon)[clayfreeman](/maintainers/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

[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[civicrm/cv

CLI tool for CiviCRM

4219.8k](/packages/civicrm-cv)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)

PHPackages © 2026

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