PHPackages                             vzaps/sdk - 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. vzaps/sdk

ActiveLibrary[API Development](/categories/api)

vzaps/sdk
=========

Official PHP SDK for the VZaps public API.

00PHPCI passing

Since Jun 27Pushed todayCompare

[ Source](https://github.com/VZaps/vzaps-sdk-php)[ Packagist](https://packagist.org/packages/vzaps/sdk)[ RSS](/packages/vzaps-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (1)Used By (0)

VZaps PHP SDK
=============

[](#vzaps-php-sdk)

[![CI](https://github.com/VZaps/vzaps-sdk-php/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/VZaps/vzaps-sdk-php/actions/workflows/ci.yml) [![SDK Documentation](https://camo.githubusercontent.com/19bc0baaa92374d9d67c995ac3836459ab23e0f8ee315fd106ab51d60c2ca449/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53444b2d446f63756d656e746174696f6e2d626c7565)](https://docs.vzaps.com/en/sdk/php/installation) [![license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](./LICENSE)[![Packagist](https://camo.githubusercontent.com/1aaa7adb5b5c28f5125cc0dc7ba5d0cc29dc5967b9eb4c8e7b47a493360db461/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f767a6170732f73646b2e737667)](https://packagist.org/packages/vzaps/sdk)[![PHP](https://camo.githubusercontent.com/7535257ca228724c93658bd52583d4e47a9bab02c356abf6e54c1d575f2151e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e737667)](https://www.php.net/)

Official PHP client for the [VZaps public API](https://docs.vzaps.com). Send WhatsApp messages, manage instances, configure webhooks, and subscribe to realtime events with a resource-oriented interface.

Works in **PHP 8.1+** with Composer. HTTP uses Guzzle 7 by default. WebSocket realtime is intended for CLI workers and daemons; install `textalk/websocket` or inject a custom WebSocket factory.

---

Table of contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick start](#quick-start)
- [Authentication](#authentication)
- [Configuration](#configuration)
- [Resources](#resources)
- [Instance tokens](#instance-tokens)
- [Webhooks](#webhooks)
- [Realtime events](#realtime-events)
- [Error handling](#error-handling)
- [PHP](#php)
- [Documentation](#documentation)

---

Features
--------

[](#features)

- **Automatic JWT handling** — exchanges `clientToken` + `clientSecret` for a bearer token and refreshes it before expiry.
- **Resource-oriented API** — `instances()`, `messages()`, `webhooks()`, `contacts()`, `groups()`, and `events()` mirror the public HTTP contract.
- **Realtime WebSocket client** — subscribe to instance events with reconnect, resume (`lastEventId`), and server-side ack.
- **Instance token support** — pass `instanceToken` on each instance-scoped request.
- **Request DTOs and arrays** — typed request objects for common calls; arrays for evolving API fields.
- **Extensible transport** — inject custom PSR-18 HTTP clients and WebSocket factories for tests or custom runtimes.

---

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

[](#requirements)

RuntimeMinimum versionPHP8.1+Composer2.x recommendedExtension`ext-json`The SDK uses Guzzle 7 for HTTP. Realtime WebSocket support is optional (`textalk/websocket`).

---

Installation
------------

[](#installation)

```
composer require vzaps/sdk
```

Optional realtime transport:

```
composer require textalk/websocket
```

---

Quick start
-----------

[](#quick-start)

Create credentials in the [VZaps dashboard](https://docs.vzaps.com) (`clientToken` and `clientSecret`), then send a text message:

```
