Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion references/relay-kit/hooks/useRequests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ description: Fetch cross-chain Relay transactions
sidebarTitle: useRequests
---

<Warning>
`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](/references/api/api-keys#proxy-api) that injects `x-api-key`.
</Warning>

## Parameters

| Parameter | Description | Required |
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| **baseApiUrl** | Base api url for the relay api, defaults to https://api.relay.link but can also be configured to https://api.testnets.relay.link | ❌ |
| **baseApiUrl** | Base API URL for the Relay API. `/requests/v3` requires an `x-api-key`, so point this at a server-side [proxy](/references/api/api-keys#proxy-api) that injects the key rather than at `https://api.relay.link` directly. | ❌ |
| **options** | Query parameters that map directly to the [requests api](/references/api/get-requests) | ❌ |
| **queryOptions** | Tanstack query options. Refer to the [Tanstack](https://tanstack.com/query/latest/docs/framework/react/guides/query-options) docs. | ❌ |

Expand Down
4 changes: 4 additions & 0 deletions references/relay-kit/ui/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ const App = () => {
}
```

<Warning>
The widgets read transaction history from `GET /requests/v3`, which requires a Relay API key. Set **`baseApiUrl`** to a server-side [proxy](/references/api/api-keys#proxy-api) 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.
</Warning>

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

### Styling
Expand Down
1 change: 1 addition & 0 deletions references/relay-kit/ui/relay-kit-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sidebarTitle: RelayKitProvider
| appName | The name of your application, used in the ui to contextualize actions | ❌ |
| appFees | An array of objects representing fees. Each object should contains a `recipient` wallet address and a `fee` in bps (e.g. 100 = 1%). | ❌ |
| themeScheme | The overall theme color of the app, can be `light` or `dark`. Defaults to `light`. This changes the color scheme of icons and other ui elements, in addition to the theme passed in. | ❌ |
| acknowledgeApiKeyExposure | Silences the client-side warnings shown when **`baseApiUrl`** points directly at the Relay API. `GET /requests/v3` requires an API key, so production integrations should proxy requests through their own backend and never ship the key to the browser. Set to `true` only if you understand the exposure (e.g. a public, rate-limited key). | ❌ |

The options are also a combination of all the [parameters](/references/relay-kit/sdk/createClient#options) passed to the RelayKit SDK. An sdk instance with these options is created when using this provider.

Loading