Skip to main content
Use EarnWidget when you want Pods yield UX in your app while keeping wallet custody and transaction execution in your infrastructure.

What You Own vs What Pods Owns

Verified integration contract

Install the current widget package set:
Use the same SDK package for DeframeProvider, EarnWidget, and SwapWidget. The Pods Wallet-style widget stack imports them from pods-sdk and uses @deframe-sdk/components for the shared visual system and swap view override.
For Privy smart-wallet hosts, add the wallet stack from the Privy Integration guide.

Styles and Theme

Import the published component stylesheet in your app entrypoint before your own app CSS. For Next.js App Router:
For Vite React:
Treat .deframe-widget as the style boundary owned by the SDK:
  • Scope host app styles to your own containers.
  • Avoid global resets like * { ... } or broad element resets that can leak into the widget.
  • Use DeframeProvider.config.theme as the source of truth for widget theming.
  • Use widget-scoped CSS variables only as host-side branding extensions.
  • Do not copy internal SDK view overrides into customer integrations unless you own and test those override components.

Environment Variables

Canonical client env names for widget hosts:
If you proxy Pods API calls through your own backend, pass the proxy route as NEXT_PUBLIC_PODS_API_URL and inject the API key server-side. The browser still needs NEXT_PUBLIC_PODS_WEBSOCKET_URL when realtime action updates should connect directly.
If your host uses Vite and you want to keep these same names, configure:
For non-Next hosts, add the shim used by that alias:

Step 1: Implement processBytecode

processBytecode is the host bridge between widget actions and wallet execution. Batch all legs on the same chainId into one atomic wallet submission — see processBytecode Contract and Executing Bytecode.
For the complete transaction lifecycle, see processBytecode Contract.

Step 2: Create a Shared Provider Wrapper

Use a single host wrapper for EarnWidget, SwapWidget, and any SDK hooks that need provider context.

Step 3: Mount the Invest View

The Pods Wallet-style Invest page lets the overview use a wider layout and narrows detail or transaction routes.

Route Names Exposed by onRouteChange

Common values: overview, details, deposit, withdraw, investment-details, history, history-deposit-details, history-withdraw-details. Use these to adapt host shell layout, breadcrumbs, and analytics tags.

Host Env and Provider Config Reference

[email protected] still exposes the provider fields as DEFRAME_API_URL, DEFRAME_API_KEY, and DEFRAME_WEBSOCKET_URL. Keep the host env names branded as PODS_*, then map them into those provider fields in the wrapper.

API Endpoints Used in Earn Flows

  • GET /strategies for strategy discovery
  • GET /strategies/{strategyId} for strategy details
  • GET /strategies/{strategyId}/bytecode for deposit/withdraw transaction data
  • GET /wallets/{wallet} for portfolio state
  • GET /wallets/{wallet}/history/{strategyId} for investment activity
Guides:

Customer Integration Checklist

  1. Install pods-sdk, @deframe-sdk/components, and Redux peer packages.
  2. Import @deframe-sdk/components/styles.css before your host CSS.
  3. Pass the connected wallet or smart-wallet address into DeframeProvider.config.walletAddress.
  4. Implement processBytecode with your wallet stack.
  5. Emit all required tx lifecycle statuses back to the widget.
  6. Configure NEXT_PUBLIC_PODS_WEBSOCKET_URL so the widget can recover realtime cross-chain state.
  7. Keep host CSS scoped to containers around .deframe-widget.
  8. Track completed transactions in your own ledger for reconciliation/support.