From 1d9263bfc159108a49e7e37d56affe52f9ccb45e Mon Sep 17 00:00:00 2001 From: relay-docs-bot Date: Thu, 9 Jul 2026 14:41:45 +0000 Subject: [PATCH] docs(drift): draft from relayprotocol/relay-kit#1069 Requested by @ted-palmer via /publish-docs-pr on https://github.com/relayprotocol/relay-kit/pull/1069 --- references/relay-kit/hooks/useRequests.mdx | 6 +++++- references/relay-kit/ui/installation.mdx | 4 ++++ references/relay-kit/ui/relay-kit-provider.mdx | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/references/relay-kit/hooks/useRequests.mdx b/references/relay-kit/hooks/useRequests.mdx index cc7666a1..b903ed46 100644 --- a/references/relay-kit/hooks/useRequests.mdx +++ b/references/relay-kit/hooks/useRequests.mdx @@ -4,11 +4,15 @@ description: Fetch cross-chain Relay transactions sidebarTitle: useRequests --- + +`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`. + + ## 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. | ❌ | diff --git a/references/relay-kit/ui/installation.mdx b/references/relay-kit/ui/installation.mdx index ced6071d..998408dd 100644 --- a/references/relay-kit/ui/installation.mdx +++ b/references/relay-kit/ui/installation.mdx @@ -78,6 +78,10 @@ const App = () => { } ``` + +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. + + If you're using the `convertViemChainToRelayChain` you'll need to install and import the `@relayprotocol/relay-sdk` to use this function. ### Styling diff --git a/references/relay-kit/ui/relay-kit-provider.mdx b/references/relay-kit/ui/relay-kit-provider.mdx index 58528a88..3520c9dd 100644 --- a/references/relay-kit/ui/relay-kit-provider.mdx +++ b/references/relay-kit/ui/relay-kit-provider.mdx @@ -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.