Relay
SupportGet in TouchTry Relay
Relay PlatformAPI ReferenceRelayKitRelay ProtocolChangelog

Getting Started

What is Relay?How Relay Works

Solutions

Payment Service ProvidersWallets & Wallet ProvidersMultichain AppsChainsCommerce & Payments

Use Cases

Bridging & OnboardingSwapsCall Execution

Features

App FeesFee SponsorshipDeposit AddressesGas Top-UpGasless ExecutionFast FillGasless SwapsPrice StabilizationRouting Integration Models

Security

Transaction ScreeningUnsupported ExchangesBug Bounty ProgramMEV protectionCommunity SupportContract Audits

Resources

Supported ChainsIntegrating using AISupportBrand Assets

API Reference

API OverviewQuickstartApps, API keys, and Rate LimitsAccess TokensUnderstanding Step ExecutionWallet DetectionCost & Fee StructureRefundsInput ValidationTrade TypesSurplus & ShortageHandling Quote ErrorsHandling Rate LimitsHandling Execution ErrorsContract CompatibilityBridging Integration GuideCall Execution Integration GuideTransaction IndexingBase Builder CodesSmart Accounts in RelayTestnet SupportSolana SupportBitcoin SupportHyperliquid SupportLighter SupportDeep LinkingWebsocketsWebhooksMigrating to Requests v3Migrating to Currencies v2Migrating to Token Price v2Supported ChainsContract AddressesSupported Tokens & RoutesTroubleshootingGet QuoteSubmit PermitGet StatusGet RequestsGet Published RequestsGet ChainsGet Chains LiquidityGet CurrenciesGet Currency ClassificationsGet Token PriceTransactions IndexTransactions SingleDeposit Address ReindexGet App Fee BalancesGet Balance EventsClaim App FeesGet UsageFast FillGet Swap SourcesCreate Access TokenExecute Gasless TxsAttest DepositGet Recovery BalancesRequest WithdrawalGet Withdrawal StatusGet Requests (v2)Get PriceGet ConfigGet Execution StatusGet Currencies (v1)Get Token Price (v1)Get Quote

RelayKit

OverviewInstallationcreateClientgetQuoteexecutegetAppFeesclaimAppFeesfastFillexecuteGaslessBatchAdaptersTypescript API TypingsChain UtilsInstallationuseQuoteuseRelayChainsuseRequestsuseTokenListuseTokenPriceuseExecutionStatusInstallationRelayKitProviderSwapWidgetThemingTroubleshooting

Protocol

Relay ProtocolHow It WorksThe Relay ChainDepositoryDeposit AddressesOracleHubAllocatorSecurity CouncilSecurity & AuditsFor AppsProgrammatic WithdrawalsWithdrawing with a SafeOperate a Third-Party Relay OracleAddressesEVM Depository ReferenceSVM Depository ReferenceOverviewArchitectureSecurityRelay Vaults BackendBridgingInteracting with Relay VaultsWithdrawing from Relay VaultsRelayPoolFactoryRelayPoolRelayPoolNativeGatewayRelayBridgeFactoryRelayBridge

Changelog

Changelog
## Documentation Index Fetch the complete documentation index at: https://docs.relay.link/llms.txt Use this file to discover all available pages before exploring further.
## Agent Instructions To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: npx -y @relayprotocol/relay-mcp. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.

Installation

Installing and Configuring RelayKit UI

Installation

Use this React ui package to smoothly embed a fully featured Relay powered interface into your application. Start by installing the required packages:

yarn add viem wagmi @tanstack/react-query @relayprotocol/relay-kit-ui 
npm install viem wagmi @tanstack/react-query @relayprotocol/relay-kit-ui 
pnpm add viem wagmi @tanstack/react-query @relayprotocol/relay-kit-ui 
bun add viem wagmi @tanstack/react-query @relayprotocol/relay-kit-ui 

If using typescript ensure that you're on v5+. Refer to the package json for the latest version requirements for the peer dependencies.

Tanstack Query Setup

The hooks require TanStack Query to be installed and configured. Refer to the Tanstack installation instructions.

Configuration

Once all dependencies are installed you can now configure and wrap your application with the RelayKitProvider. You'll need to also wrap your application with the QueryClientProvider and the WagmiProvider. Note the order in the snippet below.

import { RelayKitProvider } from '@relayprotocol/relay-kit-ui'
import { convertViemChainToRelayChain } from '@relayprotocol/relay-sdk'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { http, createConfig, WagmiProvider } from '@wagmi/core'
import { mainnet } from '@wagmi/core/chains'
import { MAINNET_RELAY_API, TESTNET_RELAY_API } from '@relayprotocol/relay-sdk'
import '@relayprotocol/relay-kit-ui/styles.css'

const queryClient = new QueryClient()

const chains = [convertViemChainToRelayChain(mainnet)]

const wagmiConfig = createConfig({
  appName: 'Relay Demo',
  chains: [mainnet],
  transports: {
    [mainnet.id]: http(),
  }
})

const App = () => {
  return (
    <QueryClientProvider client={queryClient}>
		<RelayKitProvider options={{
			appName: 'Relay Demo',
			appFees: [
			  {
				recipient: '0x0000000000000000000000000000000000000000',
				fee: '100' // 1%
			  }
			],
			codexConfig: {
				apiKey: "YOUR_CODEX_KEY",
			},
			chains,
			baseApiUrl: MAINNET_RELAY_API
		  }}>
        <WagmiProvider config={wagmiConfig}>
          <YourApp />
        </WagmiProvider>
      </RelayKitProvider>
    </QueryClientProvider>
  )
}
[!WARNING] The widgets read transaction history from GET /requests/v3, which requires a Relay API key. Set `baseApiUrl` to a server-side proxy that injects x-api-key — do not pass the key from the browser. When baseApiUrl points directly at the Relay API, RelayKitProvider logs a client-side warning.

If you're using the convertViemChainToRelayChain you'll need to install and import the @relayprotocol/relay-sdk to use this function.

Styling

Make sure to import the styles.css globally otherwise the components will be unstyled:

import '@relayprotocol/relay-kit-ui/styles.css'

Configuring Chains Dynamically

While you can easily supply chains that your application supports, you may want to fetch the supported Relay chains dynamically and configure them in your application. This can be done by using the useRelayChains hook.

import { useRelayChains } from '@relayprotocol/relay-kit-hooks'
import { RelayKitProvider } from '@relayprotocol/relay-kit-ui'
import { convertViemChainToRelayChain } from '@relayprotocol/relay-sdk'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { http, createConfig, WagmiProvider } from '@wagmi/core'
import { mainnet } from '@wagmi/core/chains'
import { MAINNET_RELAY_API, TESTNET_RELAY_API } from '@relayprotocol/relay-sdk'

const queryClient = new QueryClient()

const App = () => {
  const [wagmiConfig, setWagmiConfig] = useState<
    ReturnType<typeof createConfig> | undefined
  >()
  const { chains, viemChains } = useRelayChains(MAINNET_RELAY_API)

  useEffect(() => {
    if (!wagmiConfig && chains && viemChains) {
      setWagmiConfig(
        createConfig({
          appName: 'Relay Demo',
          chains: (viemChains && viemChains.length === 0
            ? [mainnet]
            : viemChains) as [Chain, ...Chain[]],
          transports: {
            [mainnet.id]: http(),
          }
        })
      )
    }
  }, [chains])

  //Prevent loading the page until wagmi config is set, you can set a temporary config to swap out later to unblock the ui
  if (!wagmiConfig) {
    return null
  }

  return (
    <QueryClientProvider client={queryClient}>
      <RelayKitProvider options={{
		  codexConfig: {
			apiKey: "YOUR_CODEX_KEY",
		  },
          chains,
          baseApiUrl: MAINNET_RELAY_API
        }}>
        <WagmiProvider config={wagmiConfig}>
          <YourApp />
        </WagmiProvider>
      </RelayKitProvider>
    </QueryClientProvider>
  )
}

Learn more about the RelayKitProvider options.

Review

Let's review with a checklist to make sure we got everything in:

  1. Install the required dependencies
  2. Configure Tanstack Query and Wagmi
  3. Configure RelayKitProvider with chains and options
  4. Import the styles.css file to style our ui components

This documentation is built and hosted on Mintlify, a developer documentation platform.

PrevioususeExecutionStatusNextRelayKitProvider
Relay© 2026 Uneven Labs, Inc. All rights reserved.XGitHubSupport