# Worklet Bundler

Worklet Bundler packages selected WDK wallet and protocol modules into a Bare runtime bundle that runs outside your main React Native application thread. Powered by [`@tetherto/wdk-worklet-bundler`](https://github.com/tetherto/wdk-worklet-bundler).

## Features

* **Config-driven bundle generation**: Map logical network names to wallet packages and optional protocol names to protocol packages in `wdk.config.js`.
* **Generated worklet artifact**: Produce a bundle for the Bare runtime plus generated TypeScript types for the host app.
* **Dependency validation helpers**: Validate configured modules, detect the active package manager, and generate install or uninstall commands when dependencies are missing.
* **CLI workflow**: Use `init`, `validate`, `generate`, `list-modules`, and `clean` without building your own wrapper.
* **Bare suspend and resume handling**: `beta.3` generated entrypoints suspend and resume both the `bare-http1` and `bare-https` global agents when the Bare thread lifecycle changes.

## 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.
* The `beta.3` runtime fix reduces the chance that HTTPS-backed worklet fetches keep running after a Bare thread suspension.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-code">:code:</i></td><td><strong>Worklet Bundler Configuration</strong></td><td>Set up `wdk.config.js`, review defaults, and understand the generated runtime behavior.</td><td><a href="/pages/4bAAAGPsi0INHUMTwP6a">/pages/4bAAAGPsi0INHUMTwP6a</a></td></tr><tr><td><i class="fa-mobile-alt">:mobile-alt:</i></td><td><strong>Worklet Bundler API Reference</strong></td><td>Review the exported config types, dependency helpers, and bundle-generation functions.</td><td><a href="/pages/2NQBGIiZW5Ch9wT99F03">/pages/2NQBGIiZW5Ch9wT99F03</a></td></tr></tbody></table>

***

## Need Help?


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wdk.tether.io/tools/worklet-bundler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
