equidna/bird-flock

Bird Flock - messaging bus for multi-channel outbound messaging (SMS, WhatsApp, Email) with DLQ and idempotency

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/equidna/bird-flock

1.0.0 2025-11-30 21:03 UTC

This package is auto-updated.

Last update: 2025-11-30 21:20:29 UTC


README

Bird Flock is a Laravel package for reliable, multi-channel outbound messaging (SMS, WhatsApp, Email) with built-in idempotency, dead-letter queue support, circuit breakers, and provider abstraction.

This documentation follows the project's Coding Standards and PHPDoc Style Guide.

Project Overview

Bird Flock orchestrates outbound message delivery across multiple channels and providers:

  • SMS: Twilio, Vonage (Nexmo)
  • WhatsApp: Twilio
  • Email: SendGrid, Mailgun

Key Features

  • Idempotency: Prevent duplicate sends via configurable idempotency keys
  • Dead-Letter Queue (DLQ): Capture and replay failed messages
  • Circuit Breakers: Automatically suspend failing providers
  • Queue-Based: Asynchronous delivery with configurable retry policies
  • Webhook Handlers: Process delivery receipts and status updates from providers
  • Multi-Provider Support: Seamlessly switch or extend providers
  • Rate Limiting: Built-in webhook rate limiting
  • Monitoring: Health checks and circuit breaker status endpoints

Primary Use Cases

  • Transactional notifications (OTPs, receipts, alerts)
  • Marketing campaigns (scheduled bulk sends)
  • Multi-channel user engagement
  • Reliable messaging with automatic retries and failure tracking

Project Type & Tech Summary

Type: Laravel Package (Library)

Tech Stack:

  • PHP: 8.3+
  • Laravel Framework: 11.x (supports Illuminate components 10.x–12.x)
  • Database: MySQL, PostgreSQL, SQLite (Eloquent-based; driver-agnostic)
  • Cache: Any Laravel-supported driver (Redis, Memcached, File, etc.)
  • Queue: Any Laravel queue driver (Redis, Database, SQS, Beanstalkd, etc.)
  • External Services:
    • Twilio SDK (twilio/sdk ^6.0)
    • SendGrid (sendgrid/sendgrid ^7.0)
    • Vonage Client (vonage/client ^4.2)
    • Mailgun PHP (mailgun/mailgun-php ^4.3)
    • Guzzle HTTP (guzzlehttp/guzzle ^7.0)

Quick Start

1. Install via Composer

composer require equidna/bird-flock

2. Publish Configuration and Migrations

php artisan vendor:publish --tag=bird-flock-config
php artisan vendor:publish --tag=bird-flock-migrations

3. Run Migrations

php artisan migrate

4. Configure Environment

Add provider credentials to .env:

# Twilio (SMS & WhatsApp)
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM_SMS=+1234567890
TWILIO_FROM_WHATSAPP=whatsapp:+1234567890

# SendGrid (Email)
SENDGRID_API_KEY=your_api_key
SENDGRID_FROM_EMAIL=noreply@example.com
SENDGRID_FROM_NAME="Example App"

# Vonage (SMS)
VONAGE_API_KEY=your_api_key
VONAGE_API_SECRET=your_api_secret
VONAGE_FROM_SMS=YourBrand

# Mailgun (Email)
MAILGUN_API_KEY=your_api_key
MAILGUN_DOMAIN=mg.example.com
MAILGUN_FROM_EMAIL=noreply@example.com

5. Start Queue Worker

php artisan queue:work --queue=default

6. Dispatch Your First Message

use Equidna\BirdFlock\BirdFlock;
use Equidna\BirdFlock\DTO\FlightPlan;

$plan = new FlightPlan(
    channel: 'sms',
    to: '+1234567890',
    body: 'Hello from Bird Flock!',
    idempotencyKey: 'user:123:welcome-sms'
);

$messageId = BirdFlock::dispatch($plan);

Documentation Index

Detailed guides and references:

License

MIT License. See LICENSE file for details.

Author

Gabriel Ruelasgruelas@gruelas.com