> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pods.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM Integration Playbook

> Use AI assistants to implement Pods widget integrations safely

This page packages the LLM-oriented resources for Pods API + SDK integrations.

## Recommended LLM Inputs

| Resource                                                     | Use                                                                |
| ------------------------------------------------------------ | ------------------------------------------------------------------ |
| [`/llms.txt`](/llms.txt)                                     | API docs index and key concepts for retrieval-based assistants     |
| [`/llms-privy-integration.txt`](/llms-privy-integration.txt) | Full one-shot prompt for production-grade Privy widget integration |
| [EarnWidget docs](/widgets/earn-widget)                      | UI integration contract and host responsibilities                  |
| [SwapWidget docs](/widgets/swap-widget)                      | Swap integration patterns and prefill parameters                   |
| [processBytecode docs](/widgets/process-bytecode)            | Required tx lifecycle events and error handling                    |

## Prompt Template (Copy/Paste)

```text theme={null}
Implement Pods EarnWidget and SwapWidget in an existing React app.

Constraints:
- Use pods-sdk in host mode (no iframe).
- Install pods-sdk@0.2.87 and @deframe-sdk/components@0.1.91.
- Set config.components.SwapFormView = PodsSwapFormView inside DeframeProvider config.
- Install Redux peer deps explicitly: @reduxjs/toolkit, react-redux, redux.
- Import @deframe-sdk/components/styles.css once before the host app CSS.
- Keep custody in host app; implement processBytecode for signing and tx submission.
- Use NEXT_PUBLIC_PODS_API_URL, NEXT_PUBLIC_PODS_API_KEY, and NEXT_PUBLIC_PODS_WEBSOCKET_URL as host env names, then map them into the current DeframeProvider API config fields.
- Support both EN and PT language config.
- Add route-safe handling for EarnWidget onRouteChange.
- Add swap prefill support (fromTokenAddress, fromChainId, toTokenAddress, toChainId).
- Emit required tx lifecycle statuses: HOST_ACK, SIGNATURE_PROMPTED, TX_SUBMITTED, TX_CONFIRMED, TX_FINALIZED.
- Map user rejection errors (4001/ACTION_REJECTED) to SIGNATURE_DECLINED.

Deliverables:
1) Host provider wrapper with DeframeProvider config.
2) processBytecode implementation integrated with wallet stack.
3) EarnWidget page and SwapWidget page.
4) Environment variable documentation and integration checklist.
```

## Acceptance Checklist for AI-generated PRs

1. Uses `DeframeProvider` with runtime `NEXT_PUBLIC_PODS_API_URL` and `NEXT_PUBLIC_PODS_API_KEY`.
2. Passes `walletAddress` from authenticated user session.
3. Implements `processBytecode` and emits required status events.
4. Handles rejection and error status paths explicitly.
5. Does not hardcode API keys or private keys in source.
6. Keeps host CSS scoped around `.deframe-widget`.
7. Registers `config.components.SwapFormView = PodsSwapFormView` at the provider level.
8. Includes customer-facing docs and test steps.
