Skip to main content

Fastest path: AI assistants

Paste this into any AI coding agent — Claude Code, Cursor, Windsurf, ChatGPT, or anything that can fetch a URL:
Fetch https://compasslabs.ai/llms-widgets.md and integrate Compass widgets into this project.
The agent will pull the full integration guide, install dependencies, generate the provider/server/widget files, and wire up your env. Claude Code users can install the slash command for repeat use:
Then run /integrate-compass-widgets.

How it works

  1. User connects their wallet
  2. Widget shows yield opportunities (Aave, Morpho vaults, Pendle, credit, rebalancing)
  3. User picks a market, enters an amount, signs an EIP-712 transaction
  4. Your server relays the signed transaction to Compass; gas can be sponsored
  5. Each user gets a non-custodial product account — they sign every transaction themselves

Installation

You also need a wallet library. Anything that gives you an EIP-712 signer works — Privy, RainbowKit + wagmi, etc.

Quick start

Three steps: wrap with providers, add a server route, drop in a widget.

1. Providers

Using RainbowKit, wagmi, or another library? See llms-widgets.md for full provider examples.

2. Server route

CompassModule.registerAsync() is also available if you need to inject config from another module (e.g. ConfigService). Routes are served at /api/compass/* — no global prefix needed.

3. Add a widget

Tailwind users — register the package as content:

Available widgets

Each widget accepts theming and sizing props. For full prop references, see llms-widgets.md or hover the types in your IDE.

Building custom UIs

Prefer to compose your own layout? The SDK exports building blocks:
  • Shared componentsChainSwitcher, WalletStatus, EarnAccountGuard, CreditAccountGuard, EarnAccountBalance, AccountBalancesModal, DepositWithdrawForm, SwapForm, PnLSummary, TransactionHistory, CopyableAddress, ActionModal
  • Data hooksuseSwapQuote, useRebalancingData, useRefreshBalances
  • Context hooksuseCompassWallet, useCompassChain, useCompassApi, useEarnAccount, useCreditAccount

Theming

Six built-in presets: compass-dark, compass-light, minimal-dark, minimal-light, high-contrast-dark, high-contrast-light.
Override specific values:
The full schema (colors, typography, spacing, shape, effects) is exported as the Theme type — your IDE will autocomplete every override.

Wallet adapter

CompassProvider needs a wallet prop bridging your wallet library to the widgets:
signTypedData is the critical one — every transaction is EIP-712 signed by the user, then your server relays it (and optionally sponsors gas).

Supported chains

ethereum, base, arbitrum.

Gas sponsorship

Set gasSponsorPrivateKey and rpcUrls on the server handler. Widgets automatically use sponsored transactions when configured. See Gas Sponsorship.

Next steps

LLM Integration Guide

Full reference for AI-assisted integration.

Earn

The underlying Yield API.

Fixed Earn

Add fixed-yield Pendle markets to your product.

Gas Sponsorship

Sponsor gas so users never need ETH.