Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Chat Api Laravel Package

whatsapp/chat-api

whatsapp/chat-api is a Laravel/PHP package for integrating WhatsApp chat messaging into your application. It provides a convenient API for connecting your app to WhatsApp chat services and handling common messaging workflows.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What the package is. whatsapp/chat-api (mgp25/Chat-API lineage) is a reverse-engineered PHP client for the WhatsApp wire protocol. It emulates a WhatsApp client: registering a phone number via SMS/voice, negotiating Noise/Curve25519-style key exchange, exchanging protobuf-encoded binary frames, and maintaining a long-lived socket session. It is not a wrapper over an official Meta API — it is an unsupported implementation of a private, undocumented, and deliberately obfuscated protocol, with no contractual or technical relationship to WhatsApp.

Architecture fit. Poor for anything Laravel does idiomatically. The library assumes a long-running stateful process holding an open socket, an on-disk identity/key store, and a registered phone number per session. That is the opposite of PHP-FPM's request-scoped, stateless execution model. Making it fit requires a dedicated worker tier (Supervisor/queue-driven daemons), a session registry keyed by phone number, and a persistence layer for keys and message state that the package does not provide. Every one of those is a component we would own and operate, not the vendor.

Integration feasibility. Technically possible in a spike; not feasible as a production dependency. The registration surface it targets has been progressively deprecated by WhatsApp in favour of the multi-device pairing flow, which this library predates. In practice, current registration attempts via this code path are likely to fail outright or produce numbers that are rate-limited or instabanned. Feasibility therefore depends less on our engineering effort than on whether the upstream protocol happens to still accept the handshake — a condition we cannot control, test against in CI, or negotiate.

Technical risk. This is the dominant section of the assessment, and it is all red:

  • Legal/ToS risk. Use violates WhatsApp's Terms of Service and has historically attracted takedown action against the maintainer and the repository. That history is the single strongest signal available about the viability of building on it.
  • Account risk. Numbers registered this way are subject to bans with no appeal path. A ban is not an incident we can remediate; it is a permanent loss of that identity and potentially of the message history and group memberships attached to it.
  • Security risk. The package predates current dependency hygiene: an ageing protobuf implementation, legacy crypto assumptions, file-based key material with weak isolation, and no security release stream. Long-lived credential material for a messaging identity sitting in a PHP process is an attractive target and we would have no upstream to notify us of a compromise.
  • Correctness risk. Message ordering, delivery receipts, media expiry, and end-to-end encryption edge cases are all implemented by us-by-proxy, with no test vectors and no reference implementation to diff against.
  • Metadata signal. The supplied figures — score 0, dependents 0 — are not evidence of health regardless of whether they are a snapshot artifact or a genuine measurement. A package with no Packagist consumers has no downstream community finding and reporting breakage before we do.

Key questions for the business before any code is written:

  1. What is the actual requirement, and is it something the WhatsApp Business Platform (Cloud API) cannot satisfy? Template messages, opt-in flows, and business verification exist precisely to make this use case legitimate.
  2. Are we willing to own phone numbers, SIM infrastructure, and a per-ban replacement budget?
  3. Who signs off on the ToS and data-protection exposure — Legal, Security, or the requesting business unit?
  4. What is the expected service lifetime? If it is longer than one quarter, this package is disqualified on protocol drift alone.
  5. Is the value of the feature high enough to justify building and staffing a protocol-maintenance competency we do not currently have?

Integration Approach

Stack fit. Treat the library as a swappable driver behind a Laravel-native interface, never as a direct dependency in application code. Define a WhatsAppGateway contract (sendText, sendMedia, sendTemplate, onInbound) with two implementations: CloudApiGateway (official, default) and LegacyChatApiGateway (this package, opt-in, feature-flagged, environment-gated). Bind via the service container and resolve from config. Domain code, jobs, and notifications see only the contract, so the eventual migration is a config change rather than a refactor.

Isolation. The socket-holding process must not share a runtime with the web tier. Put it in its own container/service with its own Supervisor program, its own storage volume for session keys, and its own log stream. Expose it to Laravel over an internal queue (SQS/Redis) or a private HTTP boundary. That gives us a blast radius we can kill with a flag and a deployment, and it keeps key material out of the application servers.

Migration path. Sequence deliberately: (1) time-boxed spike against one disposable number to establish whether registration and send/receive still function at all; (2) if it does, ship the gateway abstraction and the official Cloud API implementation first, with the legacy driver behind a feature flag used only for internal notifications; (3) define the cutover criteria for retiring the legacy driver before it is ever switched on in production. The official path also unlocks template management, delivery webhooks, and business verification — capabilities that make the unofficial path look strictly worse on product grounds, not just on risk.

Compatibility. Expect pinned legacy PHP constraints, required extensions (curl, sockets, openssl, gmp, and a protobuf implementation), and conflict with modern dependency trees. Run it in a dedicated container image so it cannot constrain the main application's PHP or framework upgrades. Note also that it will not participate in Laravel's queue retry semantics cleanly — a socket disconnect is not a failed job, and the library's own reconnect behaviour must be wrapped with a supervisor and a dead-session detector.

Sequencing. Contract and official driver → observability and outbound audit log → spike → risk sign-off → flag-gated internal pilot → explicit decision point on whether to proceed or stop. Never let the pilot silently become production by inertia.

Operational Impact

Maintenance. The package is effectively unmaintained. Adopting it means forking it, owning the fork, and accepting that every WhatsApp protocol revision is an unplanned, unbounded engineering incident with no upstream fix to pull. Budget this as an ongoing headcount cost, not a one-off integration.

Support. There is no vendor, no SLA, no security advisory feed, and no support channel. Internal escalation ends with our own engineers reading packet captures. Any incident review will terminate at "the upstream protocol changed and we could not adapt in time."

Scaling. Not horizontally scalable in the usual sense. Sessions are pinned to a phone number and a single socket, so scaling is by number — N numbers means N sessions, N registration flows, N ban exposures, and sticky routing in front of them. State lives in files and memory rather than in a shared store, which makes autoscaling and zero-downtime deploys awkward and makes a lost volume equal a lost identity. Throughput per session is also rate-limited by an entity that does not want us there.

Failure modes to design for explicitly:

  • Silent disconnect — socket dies, no error surfaces, messages queue indefinitely. Needs heartbeat plus a watchdog that restarts and replays.
  • Number ban — sudden, permanent, no appeal. Needs a runbook, a notification to the owning team, and a replacement process that includes re-onboarding users.
  • Key/session loss — loss of the identity store means re-registration and loss of history; treat the volume as stateful, backed-up, and encrypted.
  • Registration failure — verification codes never arrive, or arrive but are rejected. No diagnosis path.
  • Duplicate or out-of-order delivery — assume at-least-once at best; enforce idempotency keys on inbound handlers.
  • Media expiry — WhatsApp media URLs are short-lived; download synchronously or lose the asset.

Ramp-up. Steep and narrow. The knowledge required is WhatsApp protocol internals plus this library's specific idioms, held by very few people. Onboarding a new engineer takes weeks and produces no transferable skill. Contrast that with the Cloud API, where onboarding is measured in days and the knowledge is documented and reusable.

Recommendation. Do not adopt this package as a production integration. Approve at most a single-digit-day spike, on a disposable number, behind a feature flag, with Legal and Security sign-off on record, and only if the requester can articulate why the official WhatsApp Business Platform is insufficient. The realistic outcome of that spike is a decision to build on the Cloud API — which is where a TPM should be steering the conversation from the start.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings