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 9mo 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 1w ago

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 74% of packages

Maintenance40

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

1940d 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

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k17.3k100](/packages/elgg-elgg)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

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

PHPackages © 2026

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