PHPackages                             juszczyk/whatsapp-php-client - 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. juszczyk/whatsapp-php-client

ActiveLibrary[API Development](/categories/api)

juszczyk/whatsapp-php-client
============================

WhatsApp API PHP Client Library

0.1.1(4mo ago)00MITPHPPHP ^8.2CI passing

Since Jan 6Pushed 4mo agoCompare

[ Source](https://github.com/bartoszjuszczyk/whatsapp-php-client)[ Packagist](https://packagist.org/packages/juszczyk/whatsapp-php-client)[ RSS](/packages/juszczyk-whatsapp-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (4)Used By (0)

WhatsApp Cloud API PHP SDK
==========================

[](#whatsapp-cloud-api-php-sdk)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/d91d3d1139cf0d8faaa80eeeeac7d3c59c9319e56960ef81c948e4160be4c4c1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d3737376262342e737667)](https://www.php.net/)[![Build Status](https://camo.githubusercontent.com/115578ff98ab837ff310d1827a0ec2882a06522d65d60ef94a9b0007fbdc6872/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626172746f737a6a75737a637a796b2f77686174736170702d7068702d636c69656e742f74657374732e796d6c)](https://github.com/bartoszjuszczyk/whatsapp-php-client/actions)

PHP library for the **WhatsApp API**.

Designed for modern PHP (8.2+) with clean architecture in mind. This library is HTTP client-agnostic—it works seamlessly with Guzzle, Symfony HTTP Client, or any other PSR-18 implementation.

🚀 Features (MVP)
----------------

[](#-features-mvp)

- ✅ **Send Text Messages**
- ✅ **Full PSR-7, PSR-17, and PSR-18 compliance**
- ✅ **Strict Types &amp; Readonly Properties** (PHP 8.2)
- ✅ **Zero-config instantiation** (via HTTP Discovery)
- ✅ **Immutability** (Immutable DTOs)

📦 Requirements
--------------

[](#-requirements)

- PHP ^8.2
- Composer
- An HTTP Client library (e.g., Guzzle, Symfony HttpClient)

📥 Installation
--------------

[](#-installation)

Install the library via Composer:

```
composer require juszczyk/whatsapp-php-client
```

### Installing an HTTP Client

[](#installing-an-http-client)

This library relies on the `php-http/discovery` abstraction. If your project does not strictly require a specific HTTP client yet, we recommend installing Guzzle:

```
composer require guzzlehttp/guzzle
```

⚡ Quick Start
-------------

[](#-quick-start)

The easiest way to instantiate the client is using the `ClientFactory`. It automatically discovers the installed HTTP client and factories.

```
use Juszczyk\WhatsApp\Factory\ClientFactory;
use Juszczyk\WhatsApp\Message\TextMessage;

require 'vendor/autoload.php';

// 1. Configuration (Token and Phone Number ID from Meta Developers panel)
$token = 'EAAG...';
$phoneId = '105...';

$whatsapp = ClientFactory::create($token, $phoneId);

// Recipient's phone number (with country code, no plus sign)
$message = new TextMessage('48123456789', 'Hello! This is a test from PHP SDK.');

try {
    $response = $whatsapp->send($message);
    echo "Message sent! ID: " . $response['messages'][0]['id'];
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

🏗️ Architecture &amp; Dependency Injection
------------------------------------------

[](#️-architecture--dependency-injection)

If you are using a framework (like Laravel or Symfony) and want to inject your own configured HTTP client (e.g., with a Logger or Retry Middleware), you can bypass the Factory and use the Constructor directly.

```
use Juszczyk\WhatsApp\Client;
use Juszczyk\WhatsApp\Config;

$config = new Config($token, $phoneId);

// You can inject any PSR-18 Client & PSR-17 Factory implementation here
$client = new Client($config, $httpClient, $requestFactory, $streamFactory);
```

🧪 Testing
---------

[](#-testing)

This library comes with a set of unit tests using PHPUnit.

```
composer test
# or
vendor/bin/phpunit
```

Static analysis (PHPStan):

```
vendor/bin/phpstan analyse
```

🗺️ Roadmap
----------

[](#️-roadmap)

Current version is an MVP. Planned features:

- Media Messages (Images, Documents)
- Template Messages
- Interactive Messages (Buttons, Lists)
- Webhooks support

📄 License
---------

[](#-license)

This library is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance76

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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

Every ~0 days

Total

2

Last Release

132d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a133d4c3d4f99c54058186066632e7b25bd7cfc7bd1c3d5c9c09a0c9816c3a8?d=identicon)[bjuszczyk](/maintainers/bjuszczyk)

---

Top Contributors

[![bartoszjuszczyk](https://avatars.githubusercontent.com/u/128232518?v=4)](https://github.com/bartoszjuszczyk "bartoszjuszczyk (19 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/juszczyk-whatsapp-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/juszczyk-whatsapp-php-client/health.svg)](https://phpackages.com/packages/juszczyk-whatsapp-php-client)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[trycourier/courier

Courier PHP SDK

16643.9k](/packages/trycourier-courier)

PHPackages © 2026

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