The @blocklet/meta library provides a comprehensive suite of utility functions for programmatically interacting with blocklet.yml metadata. These helpers streamline common tasks such as parsing, validation, data manipulation, and security operations. Whether you are building development tools, custom blocklet runtimes, or applications that interact with the Blocklet ecosystem, these APIs provide the necessary building blocks.
This section serves as a detailed reference for all exported functions, grouped by their core functionality. For a complete understanding of the metadata structure these functions operate on, please refer to the Blocklet Specification (blocklet.yml).
Explore the categories below to find the specific functions you need. Each section provides detailed explanations, parameters, and usage examples to help you get started quickly.
Parsing & Validation
Functions for reading, parsing, and validating `blocklet.yml` files. Includes `parse`, `validateMeta`, `fixAndValidateService`, and other validation helpers.
Metadata Helpers
Utilities for fetching and processing blocklet metadata from remote URLs. Includes `getBlockletMetaByUrl` and `getSourceUrlsFromConfig`.
Component & State Utilities
A collection of helper functions for working with blocklet state objects, such as traversing component trees, finding specific components, and extracting information.
DID & Wallet Utilities
Functions for handling DIDs and wallets within the blocklet context, including creating blocklet-specific DIDs, generating wallets, and extracting user information.
Security Utilities
Functions for cryptographic operations, such as signing responses, verifying signatures, and managing multi-signature verification for metadata.
Navigation Utilities
Functions for parsing and processing the `navigation` property from a blocklet's metadata and state to build dynamic user interfaces.
URL & Path Utilities
Helpers for creating URL-friendly strings and validating URL paths, useful for generating clean and valid routes.
File Utilities
Low-level functions for reading, writing, and locating `blocklet.yml` files on the filesystem, and custom Joi extensions for file validation.
Miscellaneous Utilities
A collection of other useful utilities, including communication channel helpers and identity icon (Blockies) generation.