Getting Started
This page walks you through registering your application, installing the SDK, and rendering your first savings widget.
Last updated
import { SurfWidget } from '@surf_liquid/surf-widget';
import { SurfClient } from '@surf_liquid/core-sdk';
// Create the client after the user connects their wallet
const client = new SurfClient({
provider: window.ethereum, // any EIP-1193 wallet provider
walletAddress: '0xUserAddress',
chainId: 8453, // Base mainnet (1 = Ethereum, 137 = Polygon)
appId: 'YOUR_APP_ID',
autoApprove: true,
});
// Drop the widget into your app
<SurfWidget
client={client}
walletAddress="0xUserAddress"
chainId={8453}
minDeposit={1}
theme={{ colors: { primary: '#6366f1' } }}
onSuccess={(action, txHash) => console.log(action, txHash)}
onError={(action, error) => console.error(action, error)}
/>