PHPackages                             wasaas/wasaas-php - 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. wasaas/wasaas-php

ActiveLibrary[API Development](/categories/api)

wasaas/wasaas-php
=================

Official PHP/Laravel SDK for the Wasaas WhatsApp API

v1.0.0(1mo ago)02MITPHPPHP ^8.1

Since Jun 3Pushed 1mo agoCompare

[ Source](https://github.com/Moatazkhaled93/wasaas-laravel)[ Packagist](https://packagist.org/packages/wasaas/wasaas-php)[ Docs](https://wasaas.org)[ RSS](/packages/wasaas-wasaas-php/feed)WikiDiscussions main Synced 1w ago

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

wasaas-php
==========

[](#wasaas-php)

Official PHP/Laravel SDK for the [Wasaas WhatsApp API](https://wasaas.org).

Send WhatsApp messages, validate numbers, and manage sessions — with a clean PHP interface and a first-class Laravel integration.

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

[](#requirements)

- PHP 8.1+
- ext-curl
- Laravel 10+ *(optional — plain PHP works too)*

Install
-------

[](#install)

```
composer require wasaas/wasaas-php
```

Laravel setup
-------------

[](#laravel-setup)

Publish the config file:

```
php artisan vendor:publish --tag=wasaas-config
```

Add your API key to `.env`:

```
WASAAS_API_KEY=wsa_your_key_here
```

Get your API key at [wasaas.org](https://wasaas.org) — free 7-day trial, no credit card.

---

Usage — Laravel (Facade)
------------------------

[](#usage--laravel-facade)

```
use Wasaas\Laravel\Facades\Wasaas;

// Send a text message
Wasaas::messages()->sendText(
    sessionId: 'my-session',
    to:        '966501234567',
    message:   'Your order #1234 has shipped! 🚚',
);

// Send an image
Wasaas::messages()->sendImage(
    sessionId: 'my-session',
    to:        '966501234567',
    imageUrl:  'https://example.com/invoice.png',
    caption:   'Invoice #1234',
);

// List connected sessions
$sessions = Wasaas::sessions()->list();

// Check if a number has WhatsApp
$result = Wasaas::numbers()->validate('my-session', '966501234567');
// ['exists' => true, 'phone' => '966501234567']
```

Usage — Laravel (Dependency Injection)
--------------------------------------

[](#usage--laravel-dependency-injection)

```
use Wasaas\WasaasClient;

class OrderController extends Controller
{
    public function __construct(private readonly WasaasClient $wasaas) {}

    public function notify(Order $order): void
    {
        $this->wasaas->messages->sendText(
            sessionId: config('wasaas.session_id'),
            to:        $order->customer_phone,
            message:   "Order #{$order->id} confirmed! We'll notify you when it ships.",
        );
    }
}
```

Usage — Plain PHP (no Laravel)
------------------------------

[](#usage--plain-php-no-laravel)

```
use Wasaas\WasaasClient;

$client = new WasaasClient(apiKey: 'wsa_your_key_here');

// Send text
$client->messages->sendText(
    sessionId: 'my-session',
    to:        '966501234567',
    message:   'Hello from PHP!',
);

// Send document
$base64 = base64_encode(file_get_contents('/path/to/invoice.pdf'));

$client->messages->sendDocument(
    sessionId: 'my-session',
    to:        '966501234567',
    base64:    $base64,
    filename:  'invoice-1234.pdf',
    mime:      'application/pdf',
    caption:   'Your invoice is attached',
);
```

---

API reference
-------------

[](#api-reference)

### `messages`

[](#messages)

MethodParametersDescription`sendText()``sessionId, to, message`Send a plain text message`sendImage()``sessionId, to, imageUrl, caption?`Send an image by URL`sendDocument()``sessionId, to, base64, filename, mime, caption?`Send a document### `sessions`

[](#sessions)

MethodParametersDescription`list()`—List all connected WhatsApp sessions### `numbers`

[](#numbers)

MethodParametersDescription`validate()``sessionId, phone`Check if a number has WhatsApp---

Error handling
--------------

[](#error-handling)

```
use Wasaas\Exceptions\WasaasApiException;
use Wasaas\Exceptions\WasaasException;

try {
    $client->messages->sendText('my-session', '966501234567', 'Hello!');
} catch (WasaasApiException $e) {
    $e->getStatusCode();  // 401 | 404 | 429 | 500
    $e->getMessage();     // "Invalid API key" | "Session not found" | ...
    $e->getDetail();      // optional server detail
} catch (WasaasException $e) {
    // connection error, invalid apiKey format, etc.
}
```

**Common status codes:**

CodeMeaning`401`Invalid or revoked API key`404`Session not found`429`Quota exceeded — upgrade your plan`500`WhatsApp session error---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) for details.

Made with ❤️ by [Lexora](https://lexora.fyi)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/93a8afe9dfa75e491c19298d712a1db7ef8cd9a3e95b2f83239831bf9a3fea87?d=identicon)[Moatazkhaled93](/maintainers/Moatazkhaled93)

---

Top Contributors

[![MoatazKhaledLam](https://avatars.githubusercontent.com/u/151516163?v=4)](https://github.com/MoatazKhaledLam "MoatazKhaledLam (1 commits)")

---

Tags

apilaravelmessagingphpsdkwasaaswhatsappwhatsapp-apiapilaravelsdkmessagingwhatsappwasaas

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wasaas-wasaas-php/health.svg)

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

###  Alternatives

[missael-anda/laravel-whatsapp

A Whatsapp Business Cloud API wrapper for Laravel.

698.3k](/packages/missael-anda-laravel-whatsapp)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[crenspire/laravel-whatsapp

Laravel WhatsApp Business API package

235.4k](/packages/crenspire-laravel-whatsapp)

PHPackages © 2026

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