enbox docs
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

ExportDescription
ProfileProtocolPublic profile, image, and link records
PreferencesProtocolOwner-only application preferences
ConnectProtocolPublic wallet discovery information
createProfileReader()Cached public-profile reader for connected and anonymous records surfaces

On this page