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

011PHP

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 1mo ago

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

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community8

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://www.gravatar.com/avatar/48ce15d46f86b7e95cdf6885d04dfdb9e633e72e80b4f9924fb20c0e39153c28?d=identicon)[rivervanrain](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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