Getting Started
This guide shows how to integrate the Router OGA Swap/Bridge Widget into your React application using @routerprotocol/xplore-widget.
Prerequisites
- A React application (React 18+)
- A
networkConfigUrlendpoint in your app that serves network configuration JSON at runtime
Installation
npm i @routerprotocol/xplore-widget
# or
pnpm add @routerprotocol/xplore-widget
# or
yarn add @routerprotocol/xplore-widget
Basic Usage (minimal)
import { BlinqWidget } from '@routerprotocol/xplore-widget';
import '@routerprotocol/xplore-widget/style.css';
export function App() {
return (
<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
}}
/>
);
}
With Initial State
<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
initialState: {
fromChainId: '4217',
toChainId: '8453',
},
}}
/>;
Use the Widget Playground
Use the Widget Playground to preview widget behavior and validate your defaults (theme, initial state, nodes) before shipping.
Next Steps
- Learn about all SDK Configuration options
- Check out Examples for different use cases
- Explore Customization options
- For wallet setups, see Advanced config → Wallet management