PHPackages                             kain/emqx-management-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. kain/emqx-management-api

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

kain/emqx-management-api
========================

EMQX Management HTTP API

4.3.0(5y ago)5453MITPHPPHP &gt;=7.4

Since Jun 17Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/kainonly/emqx-management-api)[ Packagist](https://packagist.org/packages/kain/emqx-management-api)[ RSS](/packages/kain-emqx-management-api/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

EMQ X HTTP API
==============

[](#emq-x-http-api)

EMQ X 管理组件资源开放接口 PHP 的实现版

安装
--

[](#安装)

```
composer require kain/emqx-management-api
```

快速开始
----

[](#快速开始)

创建客户端

```
$emqx = \EMQX\API\EMQXClient::create(
    'http://localhost:8081/api/v4/',
    '',
    ''
);

$response = $emqx->endpoints();
if ($response->isError()) {
    echo $response->getMsg();
    return;
}

var_dump($response->result());
```

或者自定义 `\GuzzleHttp\Client`

```
$client = new \GuzzleHttp\Client([
    'base_uri' => 'http://localhost:8081/api/v4/',
    'auth' => ['', ''],
    'timeout' => 30.0,
    'debug' => false,
    'verify' => false,
    'version' => 1.1
]);

$emqx = new \EMQX\API\EMQXClient($client);

$response = $emqx->endpoints();
if ($response->isError()) {
    echo $response->getMsg();
    return;
}

var_dump($response->result());
```

发布消息

```
$option = new \EMQX\API\Common\MqttPublishOption(
    ['notification'],
    'hello'
);
$option->setEncoding('plain');
$option->setQos(0);
$option->setRetain(false);
$response = $emqx->mqtt()->publish($option);

if ($response->isError()) {
    echo $response->getMsg();
    return;
}
var_dump($response->result());
```

SDK 遵循官网文档开发，

重大变更
----

[](#重大变更)

- 从`4.3.0` 版本开始 `Response` 不再使用 `getData()` 并替换为 `getBody()` 返回接口默认响应体

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance43

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Every ~103 days

Total

4

Last Release

1895d ago

Major Versions

0.2.0 → 4.2.02020-10-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9986159?v=4)[Kain](/maintainers/kainonly)[@kainonly](https://github.com/kainonly)

---

Top Contributors

[![kainonly](https://avatars.githubusercontent.com/u/9986159?v=4)](https://github.com/kainonly "kainonly (25 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kain-emqx-management-api/health.svg)

```
[![Health](https://phpackages.com/badges/kain-emqx-management-api/health.svg)](https://phpackages.com/packages/kain-emqx-management-api)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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