PHPackages                             xyzj91/emqx-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. [API Development](/categories/api)
4. /
5. xyzj91/emqx-api

ActiveLibrary[API Development](/categories/api)

xyzj91/emqx-api
===============

EMQX Management HTTP API

2.0.0(4y ago)04MITPHPPHP &gt;=7.4

Since Apr 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xyzj91/emqx-api)[ Packagist](https://packagist.org/packages/xyzj91/emqx-api)[ RSS](/packages/xyzj91-emqx-api/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

EMQ X HTTP API Hyperf版
======================

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

EMQ X 管理组件资源开放接口 Hyperf版,组件基于[https://github.com/kainonly/emqx-management-api.git修改而来](https://github.com/kainonly/emqx-management-api.git%E4%BF%AE%E6%94%B9%E8%80%8C%E6%9D%A5)

安装
--

[](#安装)

```
composer require xyzj91/emqx-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 遵循官网文档开发，

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

1526d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8553920?v=4)[Happy Li](/maintainers/xyzj91)[@xyzj91](https://github.com/xyzj91)

---

Top Contributors

[![xyzj91](https://avatars.githubusercontent.com/u/8553920?v=4)](https://github.com/xyzj91 "xyzj91 (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

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

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

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[neuron-core/neuron-ai

The PHP Agentic Framework.

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

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M733](/packages/sylius-sylius)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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