PHPackages                             nexo/plugin-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nexo/plugin-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nexo/plugin-sdk
===============

PHP SDK for nexo subprocess plugins

v0.3.0(4w ago)02↓100%MITPHPPHP ^8.1

Since May 11Pushed 4w agoCompare

[ Source](https://github.com/lordmacu/nexo-plugin-sdk-php)[ Packagist](https://packagist.org/packages/nexo/plugin-sdk)[ Docs](https://github.com/lordmacu/nexo-plugin-sdks/tree/main/php)[ RSS](/packages/nexo-plugin-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

nexo/plugin-sdk (PHP)
=====================

[](#nexoplugin-sdk-php)

Child-side SDK for nexo subprocess plugins written in PHP 8.1+. Mirrors the Rust counterpart in [`crates/microapp-sdk/`](https://github.com/lordmacu/nexo-rs/tree/main/crates/microapp-sdk), the Python counterpart in [`python/`](../python), and the TypeScript counterpart in [`typescript/`](../typescript). Same wire format ([`nexo-plugin-contract.md`](https://github.com/lordmacu/nexo-rs/blob/main/nexo-plugin-contract.md)), different language.

The reference plugin template lives at [the PHP plugin template](https://github.com/lordmacu/nexo-rs/tree/main/extensions/template-plugin-php) (or run `nexo plugin new --lang php`); copy that directory to start a new plugin.

Public API
----------

[](#public-api)

```
use Nexo\Plugin\Sdk\PluginAdapter;     // async dispatch loop
use Nexo\Plugin\Sdk\BrokerSender;      // write-only broker handle
use Nexo\Plugin\Sdk\Event;             // value object
use Nexo\Plugin\Sdk\Manifest;          // standalone TOML parser
use Nexo\Plugin\Sdk\StdoutGuard;       // defensive guard installable independently
use Nexo\Plugin\Sdk\Wire;              // JSON-RPC frame helpers + MAX_FRAME_BYTES
use Nexo\Plugin\Sdk\PluginError;       // base exception
use Nexo\Plugin\Sdk\ManifestError;     // raised when nexo-plugin.toml is malformed
use Nexo\Plugin\Sdk\WireError;         // raised on malformed JSON-RPC or oversized frames
```

Minimal example
---------------

[](#minimal-example)

```
