Hooks
useRequests
Fetch cross-chain Relay transactions
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Fetch cross-chain Relay transactions
useRequests and queryRequests read from GET /requests/v3, which requires a Relay API key sent via the x-api-key header. Because these hooks run in the browser, never ship your API key to the client — point baseApiUrl at a server-side proxy that injects x-api-key.| Parameter | Description | Required |
|---|---|---|
| baseApiUrl | Base API URL for the Relay API. /requests/v3 requires an x-api-key, so point this at a server-side proxy that injects the key rather than at https://api.relay.link directly. | ❌ |
| options | Query parameters that map directly to the requests api | ❌ |
| queryOptions | Tanstack query options. Refer to the Tanstack docs. | ❌ |
import { useRequests } from '@relayprotocol/relay-kit-hooks'
const { data: transactions } = useRequests()
import { queryRequests } from '@relayprotocol/relay-kit-hooks'
queryRequests()
Was this page helpful?