PHPackages                             xgerhard/nbheaders - 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. xgerhard/nbheaders

ActivePackage

xgerhard/nbheaders
==================

Easily parse Nightbot headers

0.0.3(4y ago)249↓100%MITPHPPHP &gt;=5.6

Since Sep 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xgerhard/nbheaders)[ Packagist](https://packagist.org/packages/xgerhard/nbheaders)[ RSS](/packages/xgerhard-nbheaders/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

nbheaders
=========

[](#nbheaders)

Easily handle Nightbot headers

Example:
--------

[](#example)

```
require 'vendor/autoload.php';

$nbheaders = new xgerhard\nbheaders\nbheaders;

if($nbheaders->isNightbotRequest())
    echo 'Platform: '. $nbheaders->getProvider() .' | User: '. http_build_query($nbheaders->getUser(), '', ', ') .' | Channel: '. http_build_query($nbheaders->getChannel(), '', ', ') .' | Timer: '. ($nbheaders->isTimer() ? 'Yes' : 'No') .' | Moderator: '. ( $nbheaders->isUserModerator() ? 'Yes' : 'No');
else
    echo 'Not a Nightbot request';

// Available functions:
// getUser() retrieve user info who called the command
// getChannel() retrieve channel info where the command was used
// getResponseUrl() retrieve response url to use with Nightbot API
// getProvider() retrieve the provider e.g. twitch, youtube, discord
// isNightbotRequest() checks if the command was called by Nightbot
// isTimer() checks if the command is called from a timer (Returns false if its called by a user)
// isUserModerator() checks if the user calling the command is a moderator
```

Test example above:
-------------------

[](#test-example-above)

`!commands add !nb $(urlfetch https://2g.be/twitch/Nightbot/headers.php)`

Install nbheaders in your project:
----------------------------------

[](#install-nbheaders-in-your-project)

`composer require xgerhard/nbheaders`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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 ~422 days

Total

3

Last Release

1586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec7ded9a1684bbc46d8b62eb52bcc0edac1d2185a6bf73df99ef2b3e6dd77539?d=identicon)[xgerhard](/maintainers/xgerhard)

---

Top Contributors

[![xgerhard](https://avatars.githubusercontent.com/u/13732765?v=4)](https://github.com/xgerhard "xgerhard (19 commits)")

### Embed Badge

![Health badge](/badges/xgerhard-nbheaders/health.svg)

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

PHPackages © 2026

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