PHPackages                             commet/commet-php - 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. [Payment Processing](/categories/payments)
4. /
5. commet/commet-php

ActiveLibrary[Payment Processing](/categories/payments)

commet/commet-php
=================

Commet PHP SDK - Billing and usage tracking for SaaS applications

v7.2.0(2w ago)022[1 PRs](https://github.com/commet-labs/commet-php/pulls)MITPHPPHP ^8.1CI failing

Since Apr 6Pushed 2w agoCompare

[ Source](https://github.com/commet-labs/commet-php)[ Packagist](https://packagist.org/packages/commet/commet-php)[ RSS](/packages/commet-commet-php/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (13)Versions (30)Used By (0)

Commet PHP SDK
==============

[](#commet-php-sdk)

Billing and usage tracking for SaaS applications.

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

[](#installation)

```
composer require commet/commet-php
```

Quick start
-----------

[](#quick-start)

```
use Commet\Commet;

$commet = new Commet(apiKey: 'ck_xxx');

// Create a customer
$commet->customers->create(email: 'user@example.com', externalId: 'user_123');

// Create a subscription
$commet->subscriptions->create(externalId: 'user_123', planCode: 'pro');

// Track usage
$commet->usage->track(feature: 'api_calls', externalId: 'user_123');

// Track AI token usage
$commet->usage->track(
    feature: 'ai_generation',
    externalId: 'user_123',
    model: 'claude-sonnet-4-20250514',
    inputTokens: 1000,
    outputTokens: 500,
);
```

Customer context
----------------

[](#customer-context)

Scope all operations to a customer to avoid repeating `externalId`:

```
$customer = $commet->customer('user_123');

$customer->usage->track('api_calls');
$customer->features->check('custom_branding');
$customer->seats->add('editor', count: 3);
$customer->portal->getUrl();
```

Quota
-----

[](#quota)

Track consumption against a fixed allowance:

```
$commet->quota->add(featureCode: 'tasks', count: 3, customerId: 'user_123');
$commet->quota->set(featureCode: 'tasks', count: 10, customerId: 'user_123');
$commet->quota->remove(featureCode: 'tasks', count: 1, customerId: 'user_123');

$allowance = $commet->quota->get(featureCode: 'tasks', customerId: 'user_123');

$allowances = $commet->quota->getAll(customerId: 'user_123');
```

Webhook verification
--------------------

[](#webhook-verification)

```
use Commet\Webhooks;

$webhooks = new Webhooks();

$payload = $webhooks->verifyAndParse(
    rawBody: $requestBody,
    signature: $_SERVER['HTTP_X_COMMET_SIGNATURE'] ?? null,
    secret: 'whsec_xxx',
);

if ($payload === null) {
    throw new \RuntimeException('Invalid webhook signature');
}

if ($payload['event'] === 'subscription.activated') {
    // handle activation
}
```

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance96

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.5% 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 ~3 days

Total

23

Last Release

18d ago

Major Versions

v2.0.0 → v3.0.02026-05-12

v3.1.0 → v4.0.02026-05-13

v4.6.0 → v5.0.02026-05-27

v5.5.0 → v6.0.02026-06-09

v6.0.0 → v7.0.02026-06-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/59459088?v=4)[Decker](/maintainers/decker-dev)[@decker-dev](https://github.com/decker-dev)

---

Top Contributors

[![decker-dev](https://avatars.githubusercontent.com/u/59459088?v=4)](https://github.com/decker-dev "decker-dev (43 commits)")[![fjalil7](https://avatars.githubusercontent.com/u/69066391?v=4)](https://github.com/fjalil7 "fjalil7 (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/commet-commet-php/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k39](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[imdhemy/google-play-billing

Google Play Billing

491.5M5](/packages/imdhemy-google-play-billing)

PHPackages © 2026

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