PHPackages                             rasuvaeff/yii3-outbox-webhooks-bridge - 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. rasuvaeff/yii3-outbox-webhooks-bridge

ActiveLibrary[API Development](/categories/api)

rasuvaeff/yii3-outbox-webhooks-bridge
=====================================

Bridge between yii3-outbox and yii3-webhooks for durable at-least-once webhook delivery

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

Since Jun 19Pushed todayCompare

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

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

rasuvaeff/yii3-outbox-webhooks-bridge
=====================================

[](#rasuvaeffyii3-outbox-webhooks-bridge)

[![Stable Version](https://camo.githubusercontent.com/c69e44bbcad74926b1e7e9531714a153a95a33d458d68b3daca98d17fd241d2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261737576616566662f796969332d6f7574626f782d776562686f6f6b732d6272696467652e737667)](https://packagist.org/packages/rasuvaeff/yii3-outbox-webhooks-bridge)[![Total Downloads](https://camo.githubusercontent.com/b712a6b65c82cc47db2b9770b4316d1a859c9b39445fce119227a23ad82910f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261737576616566662f796969332d6f7574626f782d776562686f6f6b732d6272696467652e737667)](https://packagist.org/packages/rasuvaeff/yii3-outbox-webhooks-bridge)[![Build](https://github.com/rasuvaeff/yii3-outbox-webhooks-bridge/actions/workflows/build.yml/badge.svg)](https://github.com/rasuvaeff/yii3-outbox-webhooks-bridge/actions/workflows/build.yml)[![Static analysis](https://github.com/rasuvaeff/yii3-outbox-webhooks-bridge/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/rasuvaeff/yii3-outbox-webhooks-bridge/actions/workflows/static-analysis.yml)[![Psalm level](https://camo.githubusercontent.com/8a77a3a63c18b167467c44ba8429a67479ca7f01505e33cbf965c2bca91ef774/68747470733a2f2f73686570686572642e6465762f6769746875622f7261737576616566662f796969332d6f7574626f782d776562686f6f6b732d6272696467652f6c6576656c2e737667)](https://shepherd.dev/github/rasuvaeff/yii3-outbox-webhooks-bridge)[![License](https://camo.githubusercontent.com/6cb285b57819f8de0acfb34923298f4f569f962544e8fe35331da2d163f4e485/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d2d332d2d436c617573652d626c75652e737667)](LICENSE.md)

Bridges `yii3-outbox` and `yii3-webhooks` for durable at-least-once webhook delivery. Each outbox message is converted to a `WebhookEvent` and dispatched to configured endpoints via an injected `WebhookDispatcher`.

> Using an AI coding assistant? [llms.txt](llms.txt) has a compact API reference designed for LLMs.

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

[](#requirements)

- PHP 8.3–8.5
- `rasuvaeff/yii3-outbox` ^1.0
- `rasuvaeff/yii3-webhooks` ^1.0
- A `WebhookDispatcher` implementation (e.g. a PSR-18-based adapter in your app)
- A `WebhookDeliveryStorage` implementation (e.g. `yii3-webhooks-db`)

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

[](#installation)

```
composer require rasuvaeff/yii3-outbox-webhooks-bridge
```

Usage
-----

[](#usage)

### 1. Configure endpoints

[](#1-configure-endpoints)

```
use Rasuvaeff\Yii3OutboxWebhooksBridge\ConfigWebhookEndpointProvider;
use Rasuvaeff\Yii3Webhooks\WebhookEndpoint;

$endpointProvider = new ConfigWebhookEndpointProvider(map: [
    'order.created' => [
        new WebhookEndpoint(url: 'https://partner-a.example.com/hooks', secret: 'secret-a'),
        new WebhookEndpoint(url: 'https://partner-b.example.com/hooks', secret: 'secret-b'),
    ],
    'order.paid' => [
        new WebhookEndpoint(url: 'https://partner-a.example.com/hooks', secret: 'secret-a'),
    ],
]);
```

### 2. Wire the publisher

[](#2-wire-the-publisher)

```
use Rasuvaeff\Yii3OutboxWebhooksBridge\OutboxWebhookPublisher;

$publisher = new OutboxWebhookPublisher(
    dispatcher: $dispatcher,        // your WebhookDispatcher impl
    endpointProvider: $endpointProvider,
    deliveryStorage: $deliveryStorage, // e.g. DbWebhookDeliveryStorage
);
```

### 3. Run the outbox processor

[](#3-run-the-outbox-processor)

```
use Rasuvaeff\Yii3Outbox\Processor;

$processor = new Processor(
    storage: $outboxStorage,
    publisher: $publisher,
    clock: $clock,
);

// In a background worker or console command:
$result = $processor->process(types: ['order.created', 'order.paid']);
```

### Behaviour

[](#behaviour)

SituationResultEndpoint returns `Delivered`Delivery saved; message marked publishedEndpoint returns `Failed`Delivery saved; `PublishException` thrown → outbox retriesDispatcher throws`PublishException` thrown → outbox retriesNo endpoints for typeSilent success (zero deliveries, message published)Multiple endpoints, one failsAll dispatched; `PublishException` thrown → all retried### Event id dedup

[](#event-id-dedup)

The outbox message id is reused as the `WebhookEvent` id. On retry, the same id is sent again. Receivers should use the `X-Webhook-Id` header (set by `HmacSha256Signer`) for idempotency.

### Custom endpoint provider

[](#custom-endpoint-provider)

Implement `WebhookEndpointProvider` to load endpoints from a database, cache, or any runtime source:

```
use Rasuvaeff\Yii3OutboxWebhooksBridge\WebhookEndpointProvider;
use Rasuvaeff\Yii3Webhooks\WebhookEndpoint;

final readonly class DbWebhookEndpointProvider implements WebhookEndpointProvider
{
    public function __construct(private \PDO $db) {}

    public function getEndpointsForType(string $type): array
    {
        // load from DB...
    }
}
```

Security
--------

[](#security)

- Secrets are never stored in `WebhookDelivery` (comes from `yii3-webhooks`).
- Use `HmacSha256Signer` (from `yii3-webhooks`) as your `WebhookDispatcher`'s signer to authenticate outbound requests.
- Receivers should validate the signature via `WebhookVerifier` and use `ReplayGuard` against nonce replay.

Examples
--------

[](#examples)

See [`examples/`](examples/) for runnable scripts.

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

[](#development)

```
docker run --rm -v "$PWD":/app -w /app composer:2 composer build
docker run --rm -v "$PWD":/app -w /app composer:2 composer cs:fix
docker run --rm -v "$PWD":/app -w /app composer:2 composer test
```

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

---

Tags

webhooksBridgeyii3outboxdurable

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[standard-webhooks/standard-webhooks

Standard Webhooks - Open source tools and guidelines for sending webhooks easily, securely, and reliably

1.7k109.5k20](/packages/standard-webhooks-standard-webhooks)[hotmeteor/receiver

A drop-in webhook handling library for Laravel

393147.1k](/packages/hotmeteor-receiver)[mpociot/captainhook

Add webhooks to your Laravel app.

3368.9k](/packages/mpociot-captainhook)[klev-o/telegram-bot-api

Simple and convenient object-oriented implementation Telegram bot API with php version ^7.4 support. You'll like it)

468.3k1](/packages/klev-o-telegram-bot-api)[shopify/shopify-app-php

Package for building Shopify apps. Authored and maintained by Shopify.

445.7k3](/packages/shopify-shopify-app-php)[dan/shopify-api

Shopify API for PHP

218.3k](/packages/dan-shopify-api)

PHPackages © 2026

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