PHPackages                             meruhook/meruhook-sdk - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. meruhook/meruhook-sdk

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

meruhook/meruhook-sdk
=====================

Laravel SDK for Meru Email Webhook Service

v1.0.2(8mo ago)01MITPHPPHP ^8.2CI passing

Since Sep 4Pushed 8mo agoCompare

[ Source](https://github.com/Meruhook/meru-laravel-sdk)[ Packagist](https://packagist.org/packages/meruhook/meruhook-sdk)[ RSS](/packages/meruhook-meruhook-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (4)Used By (0)

Meru Laravel SDK
================

[](#meru-laravel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/23ab5b1efd757be881e8257680be243c2bb6f7bb2d591e5a55c4dac5d6899748/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d657275686f6f6b2f6d657275686f6f6b2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/meruhook/meruhook-sdk)[![Tests](https://github.com/Meruhook/meru-laravel-sdk/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Meruhook/meru-laravel-sdk/actions/workflows/run-tests.yml)[![Code Style](https://github.com/Meruhook/meru-laravel-sdk/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/Meruhook/meru-laravel-sdk/actions/workflows/fix-php-code-style-issues.yml)[![PHPStan](https://github.com/Meruhook/meru-laravel-sdk/actions/workflows/phpstan.yml/badge.svg?branch=main)](https://github.com/Meruhook/meru-laravel-sdk/actions/workflows/phpstan.yml)[![Total Downloads](https://camo.githubusercontent.com/d3fe9cb1db79221a22d3c370d38725b5c8919cf63bfc69efd31279609164bba9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d657275686f6f6b2f6d657275686f6f6b2d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/meruhook/meruhook-sdk)

A comprehensive Laravel package providing a type-safe, modern SDK for the Meru email webhook service API using Saloon v3.

Overview
--------

[](#overview)

The Meru API SDK provides a fluent, Laravel-friendly interface for interacting with the Meru email webhook service. The service allows users to create temporary and permanent email addresses that forward incoming emails to configured webhook URLs.

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 10.0, 11.0, or 12.0
- Saloon v3

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

[](#installation)

You can install the package via composer:

```
composer require meruhook/meruhook-sdk
```

You can publish the config file with:

```
php artisan vendor:publish --tag="meru-config"
```

This is the contents of the published config file:

```
return [
    'base_url' => env('MERU_BASE_URL', 'https://api.meruhook.com'),
    'api_token' => env('MERU_API_TOKEN'),
    'timeout' => env('MERU_TIMEOUT', 30),
    'retry' => [
        'times' => env('MERU_RETRY_TIMES', 3),
        'delay' => env('MERU_RETRY_DELAY', 100),
    ],

    'debug' => env('MERU_DEBUG', false),
];
```

Configuration
-------------

[](#configuration)

Add your Meru API credentials to your `.env` file:

```
MERU_API_TOKEN=your_api_token_here
```

Quick Start
-----------

[](#quick-start)

### Basic Usage with Facade

[](#basic-usage-with-facade)

```
use Meruhook\MeruhookSDK\Facades\Meru;

// Create a new email address
$address = Meru::addresses()->create('https://myapp.com/webhook');

// List all addresses
$addresses = Meru::addresses()->list();

// Get usage statistics
$usage = Meru::usage()->get();

// Get billing information
$billing = Meru::billing()->get();
```

### Dependency Injection

[](#dependency-injection)

```
use Meruhook\MeruhookSDK\MeruConnector;
use Meruhook\MeruhookSDK\Resources\AddressResource;

class EmailWebhookService
{
    public function __construct(
        private MeruConnector $meru
    ) {}

    public function createWebhookEndpoint(string $webhookUrl): Address
    {
        return $this->meru->addresses()->create($webhookUrl);
    }
}
```

Address Management
------------------

[](#address-management)

### Creating Addresses

[](#creating-addresses)

```
// Create permanent address
$address = Meru::addresses()->create('https://myapp.com/webhook');

// Create temporary address
$address = Meru::addresses()->create('https://myapp.com/webhook', isPermanent: false);
```

### Managing Addresses

[](#managing-addresses)

```
// Get specific address
$address = Meru::addresses()->get('addr_123');

// Update webhook URL
$address = Meru::addresses()->updateWebhookUrl('addr_123', 'https://newwebhook.com');

// Enable/disable addresses
$address = Meru::addresses()->enable('addr_123');
$address = Meru::addresses()->disable('addr_123');

// Delete address
Meru::addresses()->delete('addr_123');
```

Usage Statistics
----------------

[](#usage-statistics)

```
// Get current month usage
$usage = Meru::usage()->get();

// Get usage events (audit trail)
$events = Meru::usage()->events(limit: 100);

// Get usage for specific period
$usage = Meru::usage()->period('2024-01');

// Access usage data
echo "Total emails: {$usage->totalEmails}";
echo "Success rate: {$usage->successRate}%";
echo "Today's emails: {$usage->todayEmails}";
```

Billing Information
-------------------

[](#billing-information)

```
// Get current billing status
$billing = Meru::billing()->get();

// Get detailed cost breakdown
$breakdown = Meru::billing()->breakdown();

// Access billing data
echo "Current cost: ${$billing->currentCost}";
echo "Projected cost: ${$billing->projectedCost}";
echo "On trial: " . ($billing->subscription->onTrial ? 'Yes' : 'No');
```

Account Information
-------------------

[](#account-information)

```
// Get user information
$user = Meru::account()->user();

// Get combined account overview
$account = Meru::account()->overview();

// Create API token
$token = Meru::account()->createApiToken('My App Token');
```

Data Transfer Objects (DTOs)
----------------------------

[](#data-transfer-objects-dtos)

All API responses are returned as strongly-typed DTOs:

### Address DTO

[](#address-dto)

```
$address->id;              // string
$address->address;         // string (email@example.com)
$address->webhookUrl;      // ?string
$address->isEnabled;       // bool
$address->isPermanent;     // bool
$address->expiresAt;       // ?Carbon
$address->emailCount;      // int
$address->isExpired;       // bool
$address->createdAt;       // Carbon
$address->updatedAt;       // Carbon
```

### Usage DTO

[](#usage-dto)

```
$usage->totalEmails;       // int
$usage->successfulEmails;  // int
$usage->failedWebhooks;    // int
$usage->todayEmails;       // int
$usage->projectedMonthly;  // int
$usage->successRate;       // float
$usage->failureRate;       // float
$usage->period;            // UsagePeriod DTO
```

### Billing DTO

[](#billing-dto)

```
$billing->currentCost;        // float
$billing->projectedCost;      // float
$billing->emailProcessingCost;// float
$billing->subscription;       // Subscription DTO
$billing->spendingLimit;      // SpendingLimit DTO
$billing->period;             // BillingPeriod DTO
```

Error Handling
--------------

[](#error-handling)

The SDK provides specific exception types for different error scenarios:

```
use Meruhook\MeruhookSDK\Exceptions\{
    MeruException,
    AuthenticationException,
    ValidationException,
    RateLimitException
};

try {
    $address = Meru::addresses()->create('invalid-url');
} catch (ValidationException $e) {
    // Handle validation errors
    echo "Validation failed: " . $e->getMessage();
} catch (AuthenticationException $e) {
    // Handle authentication errors
    echo "Authentication failed: " . $e->getMessage();
} catch (RateLimitException $e) {
    // Handle rate limiting
    echo "Rate limited: " . $e->getMessage();
} catch (MeruException $e) {
    // Handle general API errors
    echo "API error: " . $e->getMessage();
}
```

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

[](#development)

### Testing

[](#testing)

```
composer test
```

### Code Quality

[](#code-quality)

Run PHPStan analysis:

```
composer analyse
```

Format code with Laravel Pint:

```
composer format
```

### Releasing

[](#releasing)

This package uses automated releases via GitHub Actions.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Zachary Oakes](https://github.com/zacharyoakes)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance61

Regular maintenance activity

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~0 days

Total

3

Last Release

247d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d8cd16b2bd18ecc43e8f38856289d9cccc3767c39ec7b02e6ddf74fdd57098e?d=identicon)[ziptied](/maintainers/ziptied)

---

Top Contributors

[![ziptied](https://avatars.githubusercontent.com/u/379362?v=4)](https://github.com/ziptied "ziptied (9 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (3 commits)")

---

Tags

laravelsdkemailwebhookmeru

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/meruhook-meruhook-sdk/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M344](/packages/tymon-jwt-auth)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M106](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)

PHPackages © 2026

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