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(5mo ago)01MITPHPPHP ^8.2CI passing

Since Jan 6Pushed 5mo 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 today

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

30

—

LowBetter than 62% of packages

Maintenance69

Regular maintenance activity

Popularity2

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

179d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61694969?v=4)[bjuszczyk](/maintainers/bjuszczyk)[@bjuszczyk](https://github.com/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

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60216.0M85](/packages/mollie-mollie-api-php)

PHPackages © 2026

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