PHPackages                             rivervanrain/websub - 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. [API Development](/categories/api)
4. /
5. rivervanrain/websub

ActiveLibrary[API Development](/categories/api)

rivervanrain/websub
===================

A library for subscribing to and publishing WebSub feeds

021PHP

Since May 8Pushed 2y agoCompare

[ Source](https://github.com/RiverVanRain/p3k-websub)[ Packagist](https://packagist.org/packages/rivervanrain/websub)[ RSS](/packages/rivervanrain-websub/feed)WikiDiscussions elgg Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (1)

p3k-websub
==========

[](#p3k-websub)

Usage
-----

[](#usage)

### Initialize the client

[](#initialize-the-client)

```
$http = new p3k\HTTP('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) p3k-websub/0.1.0 example');
$client = new p3k\WebSub\Client($http);
```

### Discover the hub and self URLs for a topic URL

[](#discover-the-hub-and-self-urls-for-a-topic-url)

```
// Returns false unless both hub and self were found
$endpoints = $client->discover($topic);

// $endpoints['hub']
// $endpoints['self']
```

### Send the subscription request

[](#send-the-subscription-request)

```
$secret = p3k\random_string(32);
$id = p3k\random_string(32);
$callback = 'http://localhost:8080/subscriber.php?id='.$id;

$subscription = $client->subscribe($endpoints['hub'], $endpoints['self'], $callback, [
  'lease_seconds' => 300,
  'secret' => $secret
]);
```

### Verify the signature

[](#verify-the-signature)

```
$signature = $_SERVER['HTTP_X_HUB_SIGNATURE'];
$document = file_get_contents('php://input');
$valid = p3k\WebSub\Client::verify_signature($document, $signature, $secret);
```

License
-------

[](#license)

Copyright 2017 by Aaron Parecki

Available under the MIT license.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2176145?v=4)[Nikolai Shcherbin](/maintainers/rivervanrain)[@RiverVanRain](https://github.com/RiverVanRain)

---

Top Contributors

[![aaronpk](https://avatars.githubusercontent.com/u/113001?v=4)](https://github.com/aaronpk "aaronpk (2 commits)")

### Embed Badge

![Health badge](/badges/rivervanrain-websub/health.svg)

```
[![Health](https://phpackages.com/badges/rivervanrain-websub/health.svg)](https://phpackages.com/packages/rivervanrain-websub)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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