Public API Overview
Postboy exposes a public API that is designed to keep application communication explicit, typed, and consistent.
The goal of the public API is not to expose every internal detail of the library, but to provide a clear set of building blocks for working with messages, callbacks, executors, middleware, and namespaces.
What belongs to the public API
The public API includes the main concepts you use when building with Postboy:
Messages
CallbackMessages
Executors
Subscriptions
Middleware
Namespaces
Service-level operations for registration and execution
This makes it possible to work with the library in a structured way without depending on internal implementation details.
Why it matters
A clear public API helps the library stay:
easier to learn
easier to integrate
easier to migrate
easier to maintain over time
It also makes the architecture more predictable, because the same model is used for both application-level communication and bus-related operations.
Public API design principles
Postboy’s public API follows a few simple principles:
typed first — most operations are built around explicit TypeScript contracts
framework-agnostic — the API is not tied to Angular or any specific UI framework
message-driven — bus operations themselves are represented as part of the same model
extensible — middleware, namespaces, and executors can be combined as needed
consistent — similar operations follow the same conceptual pattern
What you usually do with the API
With the public API, you can typically:
define messages for application communication
publish messages through the bus
subscribe to message flows
use callback-based interactions when a response is needed
run controlled actions through executors
add or remove middleware
API surface vs internals
Postboy intentionally keeps the distinction between public API and internals clear.
The public API is meant for:
application code
integration code
framework adapters
documentation and examples
The internal services and stores are there to support the architecture, but they are not the main way users are expected to interact with the library.
In short
The Public API is the user-facing layer of Postboy.
It gives you a typed, structured way to work with event-driven communication without depending on the library’s internal mechanics.