Skip to main content

Configuration

@routerprotocol/xplore-widget is configured via a single config object (type WidgetConfig) passed to BlinqWidget.

Required Parameters

config is required. The following properties are required:

import { BlinqWidget } from '@routerprotocol/xplore-widget';
import '@routerprotocol/xplore-widget/style.css';

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
}}
/>;
Config PathTypeRequiredDescription
apiUrlstringyesRouter Protocol gRPC API endpoint URL
networkConfigUrlstringyesURL to fetch network config JSON at runtime

Swap Configuration

Configure initial swap parameters using config.initialState.

Config PathTypeDescription
initialState.fromChainIdstringDefault source chain id
initialState.fromTokenAddressstringDefault source token address
initialState.toChainIdstringDefault destination chain id
initialState.toTokenAddressstringDefault destination token address

Swap Configuration Examples

Set default tokens:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
initialState: {
fromChainId: '137',
fromTokenAddress: '0x0000000000000000000000000000000000000000',
toChainId: '1',
toTokenAddress: '0x0000000000000000000000000000000000000000',
},
}}
/>;

Network configuration

networkConfigUrl is required (see Required Parameters). Optionally restrict which chains appear in the widget:

Config PathTypeRequiredDescription
supportedChainIdsstring[]noRestrict the widget to specific chain ids (EVM numeric ids as strings, plus non‑EVM ids your networkConfigUrl defines, e.g. 'solana')

Restrict chains with supportedChainIds

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
supportedChainIds: ['1', '8453', '4217', 'solana'],
}}
/>;

Theme Configuration

Customize the widget's appearance using config.theme.

Config PathTypeOptionsDescription
theme.modestringlight, dark, autoWidget theme mode
theme.primaryColorstringHex colorPrimary brand color
theme.backgroundColorstringHex colorBackground color
theme.textColorPrimarystringHex colorPrimary text color
theme.textColorSecondarystringHex colorSecondary text color
theme.modalColorstringHex colorModal background / surface color
theme.cardBorderRadiusstringCSS valueCard border radius
theme.buttonBorderRadiusstringCSS valueButton border radius

Theme Examples

Dark theme with custom colors:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
theme: {
mode: 'dark',
primaryColor: '#7C3AED',
backgroundColor: '#1a1a1a',
textColorPrimary: '#ffffff',
textColorSecondary: '#a3a3a3',
modalColor: '#111111',
cardBorderRadius: '12px',
buttonBorderRadius: '8px',
},
}}
/>;

Light theme:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
theme: {
mode: 'light',
primaryColor: '#7C3AED',
backgroundColor: '#ffffff',
textColorPrimary: '#111111',
textColorSecondary: '#525252',
modalColor: '#f5f5f5',
cardBorderRadius: '12px',
buttonBorderRadius: '8px',
},
}}
/>;

Features Configuration

Toggle widget features using config.features.

Config PathTypeDescription
features.disableSourceTokenSelectorbooleanLock the source token selector (users can’t change the source token)
features.disableDestinationTokenSelectorbooleanLock the destination token selector (users can’t change the destination token)

Features Examples

Lock the source token selector only:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
features: { disableSourceTokenSelector: true, disableDestinationTokenSelector: false },
}}
/>;

Lock the destination token selector only:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
features: { disableSourceTokenSelector: false, disableDestinationTokenSelector: true },
}}
/>;

Lock both token selectors:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
features: { disableSourceTokenSelector: true, disableDestinationTokenSelector: true },
}}
/>;

Nodes Configuration

Select which nodes/bridges are available for routing using config.selectedNodes.

Config PathTypeDescription
selectedNodesstring[]List of node IDs to use for routing

Nodes Examples

Allow specific nodes:

<BlinqWidget
config={{
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
selectedNodes: ['relay', 'debridge'],
}}
/>;

Note: If not specified, all available nodes will be used for routing.

Settings Configuration

Configure additional widget settings.

Config PathTypeDescription
integratorstringIntegrator identifier for tracking and analytics
quoteRefreshIntervalnumberQuote refresh interval in ms (default: 30000)
wallet.onConnectClick() => voidHost-managed wallet connect hook (advanced)

Complete Configuration Example

import { BlinqWidget } from '@routerprotocol/xplore-widget';
import '@routerprotocol/xplore-widget/style.css';

const config = {
apiUrl: 'https://grpc-v2.routerprotocol.com',
networkConfigUrl: '/api/networks',
theme: {
mode: 'dark',
primaryColor: '#7C3AED',
backgroundColor: '#0a0a0a',
textColorPrimary: '#ffffff',
textColorSecondary: '#a0a0a0',
modalColor: '#111111',
cardBorderRadius: '10px',
buttonBorderRadius: '4px',
fontFamily: 'Inter, sans-serif',
},
initialState: {
fromChainId: '4217',
toChainId: '8453',
},
features: {
disableSourceTokenSelector: false,
disableDestinationTokenSelector: false,
},
integrator: 'your-app-name',
supportedChainIds: ['1', '8453', '4217', 'solana'],
selectedNodes: ['relay', 'debridge'],
};

export function App() {
return <BlinqWidget config={config} />;
}

Using the Widget Playground

The easiest way to explore options is using the Widget Playground, then mapping settings into the widget config object.

  1. Customize your widget using the visual interface
  2. Preview your changes in real-time
  3. Copy values for theme, feature, node, and initial state settings
  4. Integrate by passing those values into config

The playground provides a visual interface for all configuration options, making it easy to customize your widget without manually constructing URL parameters.

Security Considerations

  • Treat any API keys/secrets as sensitive
  • Prefer environment variables where applicable
  • Configure allowed domains in your Router dashboard (if/where required)

Next Steps