Skip to main content
Get Your API Key: Join the Trails Telegram group to request your API access key for Trails.
To install on your own application:
1

Install the SDK and dependencies

pnpm i 0xtrails
2

Import and Use the Widget

Add the widget to your React application, for example send 1 USDC cross-chain to a recipient on Base.
import { TrailsWidget } from '0xtrails/widget'

export const App = () => {
  return (
    <TrailsWidget
      apiKey="YOUR_API_KEY"
      mode="fund"
      toAddress="0x97c4A952b46bEcaD0663f76357d3776ba11566E1" // contract or wallet address of recipient
      toAmount="1" 
      toChainId={8453}
      toToken="USDC"
    />
  )
}

Next steps

Trails is optimized for a variety of common use cases or flows for your application:
  • Pay: Enable cross-chain, 1-click payments with any token for ecommerce platforms, NFT marketplaces, real-world asset purchases, and minimal-slippage stablecoin transactions.
  • Swap: Embed low-latency, highly liquid cross-chain token swaps for your applications.
  • Fund: Maximize TVL and transaction velocity through fully brandable funding widgets for protocol deposits such as perpetual exchanges, chain deposits, and liquidity provisioning.
  • Earn: Streamline DeFi yield opportunities by enabling deposits from your app into already integrated tokenized vaults, lending pools, and yield strategies from any token on any chain.
  • Configuration: Full list of variables & hooks to customize Trails including different modes, theming, enabling gasless transactions, events, and quote providers.
  • API Integration: Want full control over your UI / UX or integrating server-side? Leverage our endpoints directly to build your own chain abstraction flows.
For production use, pin to a specific version by replacing @latest with @1.0.0 or your desired version.