WDK logoWDK documentation

Worklet Bundler

CLI tool for generating WDK Bare worklet bundles

Worklet Bundler packages selected WDK wallet, protocol, and optional generic modules into a Bare runtime bundle that runs outside the host application thread. It can generate the default HRPC worklet used by React Native Core or a framed JSON-RPC bundle for a native host. Powered by @tetherto/wdk-worklet-bundler.

Features

  • Config-driven bundle generation: Map logical network names to wallet packages, protocol names to protocol packages, and HRPC-only generic-module names to package factories.
  • HRPC and JSON-RPC transports: Generate an HRPC JavaScript bundle by default or a length-prefixed JSON-RPC bundle for native hosts.
  • Generated worklet artifacts: Produce a Bare bundle, a stable ./.wdk host import, and generated TypeScript types.
  • Native addon outputs: Link iOS, macOS, and Android addons and generate addons.yml for JSON-RPC/native integrations.
  • Dependency validation helpers: Validate configured modules, detect the active package manager, and generate install or uninstall commands when dependencies are missing.
  • Dynamic-call allowlists: Restrict generated wallet and protocol callMethod() surfaces for HRPC and JSON-RPC, plus generic-module callModule() surfaces for HRPC.
  • Optional peer deferral: Defer missing peers marked optional by their package metadata, or require them at build time with --no-defer-optional-peers.
  • CLI workflow: Use init, validate, generate, list-modules, and clean without building your own wrapper.
  • Bare lifecycle handling: Generated HRPC entrypoints suspend and resume both the bare-http1 and bare-https global agents and log Bare suspend, resume, and idle events.

v1.0.0-beta.9 is the first npm artifact with the method-allowlist configuration introduced by the GitHub-only beta.8 release. It also includes the built CLI and API files for the JSON-RPC, generic-module, and addon-linking surface, defers genuinely missing optional peers during bundling by default, links bare-posix automatically for supported native platforms, and detects optional peers in nested, scoped, or symlinked node_modules trees.

Why this matters

  • Bundle generation keeps wallet and protocol code in a separate Bare worklet instead of the UI thread.
  • The generated type output gives the host app a stable import for the bundle surface.
  • Transport-specific defaults produce a JavaScript HRPC bundle for React Native Core or native addon artifacts for JSON-RPC hosts.

Generic modules are generated only for HRPC through beta.9. A JSON-RPC config can currently accept a modules field but silently omits those modules from the generated entrypoint.


Need Help?

On this page