Packages
@enbox/protocols
Protocol definitions and type-safe schema helpers for structuring data in Decentralized Web Nodes.
@enbox/protocols provides pre-built protocol definitions, codecs, and readers for common DWN data.
What it does
- Typed protocols — Ships ready-to-use definitions and runtime codecs for profiles, preferences, and wallet discovery.
- Profile reader — Resolves and caches public profile data from other users' DWNs.
- JSON Schemas — Publishes schemas alongside protocol data types for validation and code generation.
When to use it
- When you want to reuse a well-tested protocol definition rather than writing one from scratch
- When you need to read another user's public profile without building a cache and retry layer
Relationship to @enbox/api
Use the exported *Protocol constants directly with enbox.using(). The
matching *Definition exports remain available for low-level DWN operations.
Apps declaring their own protocols use defineProtocol() and recordCodecs
from @enbox/api instead.
Key exports
| Export | Description |
|---|---|
ProfileProtocol | Public profile, image, and link records |
PreferencesProtocol | Owner-only application preferences |
ConnectProtocol | Public wallet discovery information |
createProfileReader() | Cached public-profile reader for connected and anonymous records surfaces |