Skip to main content
Examples use React with @dynamic-labs-sdk/react-hooks. The underlying JS SDK is framework-agnostic — swap the hooks for direct calls against @dynamic-labs-sdk/client to adapt this guide to vanilla JS, Vue, Svelte, or any other framework.
The JavaScript SDK is headless, so receiving USDC always comes down to surfacing the user’s wallet address in some shape your UI can render. This guide walks through four ways to do that.

Setup

Follow the React Quickstart (JS SDK) to scaffold a Vite + React app and wire <DynamicProvider> with the EVM extension.

QR code

Generate a QR for the raw address with any QR library (e.g. qrcode.react):

Wallet address

For copy-to-clipboard flows, read address straight off the wallet account:
A “payment link” is just a URL with the recipient, amount, and chain encoded as query params. The sender lands on a page in your app that reads the params and triggers a USDC transfer from their wallet.
src/components/PaymentLinkGenerator.tsx
getActiveNetworkId returns the wallet’s current chain id (e.g. "8453" for Base) so the sender lands on the right chain. See Getting Active Network. The payment page reads the URL params, switches the sender’s wallet to the correct chain, then runs an ERC-20 transfer:
src/routes/Pay.tsx

Adding metadata

For richer payment requests (description, reference, expiry) just add more query params before generating the link:
Always validate expiresAt on the payment page before accepting the transfer.

Security considerations

  1. Validate params server-side if your app touches the recipient address or amount in any backend flow — the URL is user-controlled.
  2. Rate limit the page that processes links so a leaked URL can’t drain a wallet via auto-clicking.
  3. HTTPS only — never serve payment URLs over plain HTTP.
  4. Bound amounts — reject anything outside a sane min/max for your product.
Last modified on July 6, 2026