pk_...) from the OMS Dashboard.
Install
viem 2, and @tanstack/react-query 5.
Add a widget
Widgets need no provider. Import one from0xtrails/widget, pass your key, and set the destination.
Widgets open as a modal by default. Set
renderInline to embed one in the page. For appearance and callbacks, see configuration.
Set up the provider for hooks
Hooks such asuseQuote and useEarnMarkets need TrailsProvider above them, inside a QueryClientProvider.
Connect your users’ wallets
Widgets include their own wallet connection. If your app already manages wallets, pass them in with theadapters prop so the widget uses the same session. For apps using wagmi, install @0xtrails/adapter-wagmi and pass wagmiAdapter. For any other EIP-1193 provider, use evmAdapter from 0xtrails/widget.