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. commet/commet-php

ActiveLibrary

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

Commet PHP SDK - Billing and usage tracking for SaaS applications

v0.1.0(yesterday)00MITPHPPHP ^8.1

Since Apr 6Pushed todayCompare

[ 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 (2)Versions (2)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', environment: 'production');

// 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();
```

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
}
```

Environments
------------

[](#environments)

The SDK defaults to `sandbox`. Set `environment: 'production'` for live operations:

```
$commet = new Commet(apiKey: 'ck_xxx', environment: 'production');
```

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1d ago

### 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 (3 commits)")

###  Code Quality

TestsPHPUnit

### 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

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

277.1k](/packages/mage-os-module-automatic-translation)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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