PHPackages                             rasuvaeff/yii3-webhooks-db - 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. [Database &amp; ORM](/categories/database)
4. /
5. rasuvaeff/yii3-webhooks-db

ActiveLibrary[Database &amp; ORM](/categories/database)

rasuvaeff/yii3-webhooks-db
==========================

Database-backed delivery and nonce storage for rasuvaeff/yii3-webhooks

v1.0.0(today)00BSD-3-ClausePHPPHP 8.3 - 8.5CI passing

Since Jun 19Pushed todayCompare

[ Source](https://github.com/rasuvaeff/yii3-webhooks-db)[ Packagist](https://packagist.org/packages/rasuvaeff/yii3-webhooks-db)[ Docs](https://github.com/rasuvaeff/yii3-webhooks-db)[ RSS](/packages/rasuvaeff-yii3-webhooks-db/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (15)Versions (2)Used By (0)

rasuvaeff/yii3-webhooks-db
==========================

[](#rasuvaeffyii3-webhooks-db)

[![Stable Version](https://camo.githubusercontent.com/163ef790fe293616a35c39c2999ac971c9220514f38a87a732cd38f1f4a6081b/68747470733a2f2f706f7365722e707567782e6f72672f7261737576616566662f796969332d776562686f6f6b732d64622f762f737461626c65)](https://packagist.org/packages/rasuvaeff/yii3-webhooks-db)[![Total Downloads](https://camo.githubusercontent.com/d4493362b51305bfeac6f3d1ed1fda9ac92aa843db1c33900fe8f070dcdddecb/68747470733a2f2f706f7365722e707567782e6f72672f7261737576616566662f796969332d776562686f6f6b732d64622f646f776e6c6f616473)](https://packagist.org/packages/rasuvaeff/yii3-webhooks-db)[![Build](https://github.com/rasuvaeff/yii3-webhooks-db/actions/workflows/build.yml/badge.svg)](https://github.com/rasuvaeff/yii3-webhooks-db/actions)[![Static analysis](https://github.com/rasuvaeff/yii3-webhooks-db/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/rasuvaeff/yii3-webhooks-db/actions)[![Psalm Level](https://camo.githubusercontent.com/7c56cd542eade41607fb0dc22270ba558679002e33c5736b1f5d22798ef2fa0b/68747470733a2f2f73686570686572642e6465762f6769746875622f7261737576616566662f796969332d776562686f6f6b732d64622f6c6576656c2e737667)](https://shepherd.dev/github/rasuvaeff/yii3-webhooks-db)[![License](https://camo.githubusercontent.com/1911e7cae7742ab292eda536de84b8a34bbcf348fb37318ed0a7265a49981ac0/68747470733a2f2f706f7365722e707567782e6f72672f7261737576616566662f796969332d776562686f6f6b732d64622f6c6963656e7365)](https://packagist.org/packages/rasuvaeff/yii3-webhooks-db)

Database-backed delivery and nonce storage for `rasuvaeff/yii3-webhooks`. It provides production storage for delivery attempts and atomic replay protection.

> Using an AI coding assistant? [llms.txt](llms.txt) has a compact API reference you can use.

Requirements
------------

[](#requirements)

- PHP 8.3+
- `rasuvaeff/yii3-webhooks` ^1.0
- `yiisoft/db` ^2.0
- `yiisoft/db-migration` ^2.0
- `psr/clock` ^1.0

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

[](#installation)

```
composer require rasuvaeff/yii3-webhooks-db
```

Usage
-----

[](#usage)

Run `M260612000000CreateWebhookTables` to create `webhook_deliveries` and `webhook_nonces`.

```
use Psr\Clock\ClockInterface;
use Rasuvaeff\Yii3Webhooks\WebhookDelivery;
use Rasuvaeff\Yii3WebhooksDb\DbNonceStorage;
use Rasuvaeff\Yii3WebhooksDb\DbWebhookDeliveryStorage;

$deliveries = new DbWebhookDeliveryStorage(db: $db);
$nonces = new DbNonceStorage(db: $db, clock: $clock);

$delivery = WebhookDelivery::create(event: $event, endpoint: $endpoint);
$deliveries->save(delivery: $delivery);
$accepted = $nonces->add(nonce: $signature->getValue());
```

With `yiisoft/config`, this package binds only `WebhookDeliveryStorage` and `NonceStorage`.

API reference
-------------

[](#api-reference)

### DbWebhookDeliveryStorage

[](#dbwebhookdeliverystorage)

MethodDescription`save(delivery)`Inserts or updates a delivery row`findPending(limit)`Returns pending deliveries ordered by creation time`markDelivered(delivery)`Stores the delivery as delivered`markFailed(delivery)`Stores the delivery as failed`getById(id)`Loads a delivery by ID### DbNonceStorage

[](#dbnoncestorage)

MethodDescription`has(nonce)`Checks whether a nonce exists`add(nonce)`Atomic insert; returns false on duplicate`deleteOlderThan(threshold)`Deletes old nonces for retention cleanupSecurity
--------

[](#security)

- `DbNonceStorage::add()` relies on the primary key and catches duplicate-key errors.
- `DbWebhookDeliveryStorage` persists only `WebhookDelivery` data, never endpoint secrets.
- Keep nonce rows at least as long as your webhook timestamp tolerance window.

Examples
--------

[](#examples)

See [examples/](examples/) for a runnable SQLite example.

Development
-----------

[](#development)

```
make install
make build
make cs-fix
make test
make test-coverage
make mutation
make release-check
```

License
-------

[](#license)

BSD-3-Clause. See [LICENSE.md](LICENSE.md).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

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

---

Top Contributors

[![rasuvaeff](https://avatars.githubusercontent.com/u/1352718?v=4)](https://github.com/rasuvaeff "rasuvaeff (8 commits)")

---

Tags

databasephpwebhooksyii3databasedbwebhookyii3replay-protection

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rasuvaeff-yii3-webhooks-db/health.svg)

```
[![Health](https://phpackages.com/badges/rasuvaeff-yii3-webhooks-db/health.svg)](https://phpackages.com/packages/rasuvaeff-yii3-webhooks-db)
```

###  Alternatives

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k47.9M442](/packages/robmorgan-phinx)[kreait/firebase-php

Firebase Admin SDK

2.4k42.7M84](/packages/kreait-firebase-php)[spatie/laravel-translation-loader

Store your language lines in the database, yaml or other sources

8453.1M60](/packages/spatie-laravel-translation-loader)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4563.1M37](/packages/aura-sqlquery)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

923530.0k13](/packages/envms-fluentpdo)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

6421.0M1](/packages/sonata-project-entity-audit-bundle)

PHPackages © 2026

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