Download the PHP package afro-technology/waha-laravel-sdk without Composer

On this page you can find all versions of the php package afro-technology/waha-laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package waha-laravel-sdk

Latest Version on Packagist Total Downloads OpenAPI Sync

WAHA Laravel SDK

Laravel-oriented SDK for WAHA (WhatsApp HTTP API / Web WhatsApp gateway).
It provides:

Repository is meant to be installed into Laravel apps via Composer.


Contents


Installation

Requirements

Composer install

Laravel package discovery is enabled by default.

Publish config (recommended)

This creates config/waha.php.


Configuration

Main config: config/waha.php

Minimal .env

Hosts

Configure one or more hosts under waha.hosts:

Host authentication: admin_api_key vs session_keys

WAHA can be protected either with a single admin key (simplest) or with per-session keys (safer when you want to scope access).

⚠️ Note: the OpenAPI-generated client currently authenticates with the host’s admin_api_key (because the generator config supports one API key).
Per-session keys are used by the internal WahaHttpClient / ApiKeyProvider layer (useful for custom calls and for future extensions).

Debug

Registry, routing, and pin store (multi-host / “session → host” mapping)

This SDK can work in a simple single-host setup (no routing), but it also supports multi-host deployments where a session must consistently “stick” to the same WAHA host.

These three config blocks control that behavior:

registry

Where host definitions come from.

If WAHA_API_KEY_PROVIDER is omitted, the SDK reads admin and session keys from the host arrays returned by your custom HostRegistry.

routing

How the SDK chooses a host when you call methods without explicitly selecting one.

pin_store

Where session → host mappings are stored (used by routing.driver=pin).

Other knobs:

Typical setup for production multi-host:

  • routing.driver=pin
  • pin_store.driver=composite (or auto)
  • redis enabled + migrations applied

Response format


Quick Start

Equivalent via tag proxy (tag names come from the OpenAPI spec):


Usage

Host selection

If you don’t call host(), waha.default_host is used.

Tag proxies

Tags are exposed as methods (normalized to lowerCamel). Example:

Top-level convenience methods

Some operations are also exposed at the top level (only when their aliases are unique globally):

If an alias is not available at the top level (collision), use the tag:

Response formats

Global via .env (WAHA_RESPONSE_FORMAT) or per chain:

Works with tag proxies too:

Debug & last HTTP

Read the last captured request/response:

Enable debug only for the next call:

Scoped debug:


Webhooks

WAHA can deliver inbound events (messages, status updates, etc.) to your Laravel app via HTTP webhooks.

Endpoint and secret

When waha.webhooks.enabled is true, the package registers this route:

The route is stateless and uses the configured host key to resolve the webhook secret:

Configure the same secret in WAHA. The package verifies WAHA webhook HMAC headers before dispatching events, handlers, jobs, or storage.

Expected WAHA headers:

Processing mode

The default processing mode is sync so a fresh install works without a queue worker:

For production, prefer queue mode so WAHA is acknowledged quickly and your application work happens inside Laravel workers:

Queue mode validates the request, optionally stores an inbox event, dispatches ProcessWahaWebhookJob, and returns JSON immediately. Sync mode runs handlers inside the HTTP request and can make WAHA wait for application-level work.

Handlers

Map WAHA event names to handler classes in config/waha.php:

Handlers must implement:

Event storage

Event storage is disabled by default. To enable it, publish and run the package migrations first:

Then enable storage:

Stored events include payload metadata plus processing state such as queued, processing, processed, failed, attempt count, timestamps, and last error. Use Laravel's normal queue retry tools for retries.

Security note: treat webhook payloads as untrusted input. The package verifies accepted requests before processing.


OpenAPI workflow

This SDK uses WAHA’s OpenAPI spec to route calls and generate the underlying client. Generated client classes are namespaced under AfroTechnology\Waha\Generated, and the documented facade/tag examples only use methods exposed by the packaged proxy surface.

Common commands inside a consuming Laravel application (provided by this package):

Configuration lives under config/waha.php → openapi.

For this package repository and the scheduled GitHub Actions sync, the package-local entrypoint is php bin/openapi-sync.php; it fetches the spec, regenerates the client/proxy surface with the package namespace, and leaves the diff for review.


IDE Helper

This package can generate PHPDoc for:

Run:

Then re-index your IDE if autocompletion does not update.


Testing & CI

Local tests:

Recommended additions for public repos:

(Exact setup depends on your repo preferences.)


Versioning

Use SemVer:

Tags are important for Packagist and for stable dependency resolution.


License

MIT


All versions of waha-laravel-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1 || ^8.2 || ^8.3 || ^8.4
guzzlehttp/guzzle Version ^7.5
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package afro-technology/waha-laravel-sdk contains the following files

Loading the files please wait ...