ez-php / asyncapi-ui
Serves an HTML viewer (AsyncAPI React component from a CDN) for the AsyncAPI document produced by ez-php/asyncapi
2.7.1
2026-10-30 15:41 UTC
Requires
- php: ^8.5
- ez-php/contracts: ^2.7.0
- ez-php/http: ^2.7.0
Requires (Dev)
- ez-php/docker: ^2.7.0
- ez-php/testing-application: ^2.7.0
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^13.0
Suggests
- ez-php/asyncapi: Generates the AsyncAPI document this viewer renders (GET /asyncapi.json)
Provides
None
Conflicts
None
Replaces
None
README
An HTML viewer for your AsyncAPI document. It serves a page that renders GET /asyncapi.json
(from ez-php/asyncapi) with the official AsyncAPI
React component, loaded from jsDelivr. This is the AsyncAPI counterpart to ez-php/swagger-ui.
Installation
composer require ez-php/asyncapi-ui
Setup
// provider/modules.php EzPhp\AsyncApi\AsyncApiServiceProvider::class, // serves /asyncapi.json EzPhp\AsyncApiUi\AsyncApiUiServiceProvider::class, // serves /asyncapi-docs
config/asyncapi-ui.php (optional):
return [ 'endpoint' => getenv('ASYNCAPI_UI_ENDPOINT') ?: '/asyncapi-docs', // '' = no route 'document_url' => getenv('ASYNCAPI_UI_DOCUMENT_URL') ?: '', // '' = asyncapi.endpoint ];
The page title comes from app.name. Open /asyncapi-docs.
Notes
- Assets: loaded from jsDelivr, pinned to
@asyncapi/react-component@3.2.1with Subresource Integrity hashes. The browser loads exactly those files or nothing. Nothing is vendored. - Content-Security-Policy: if you send a CSP, it must allow
https://cdn.jsdelivr.netfor scripts and styles, plus the inlinerender(...)script. - Restricting access: set
endpointto''and register the route yourself behind your middleware:$router->get('/internal/events', [AsyncApiUiController::class, '__invoke'])->middleware('auth');
License
MIT