## 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.createClient
Create the global Relay client used by every SDK action
This method is used to create the Relay client globally in your application. The client can then be retrieved with the getClient method.
Options
| Property | Description | Required | |
|---|---|---|---|
| baseApiUrl | The base API url to use when making requests. You can use the MAINNET_RELAY_API or the TESTNET_RELAY_API constants exported by the package, or pass in your own proxy API url to protect your API key on the client. | ✅ | |
| apiKey | A Relay API key to use when making requests. Only pass in this property when the Relay client instance is used exclusively server-side. Otherwise you'll leak your key to the client. | ❌ | |
| chains | A list of Relay Chains, by default a list of backup chains is configured | ❌ | |
| source | The source to associate your onchain activity with, should map to a domain | ❌ | |
| logLevel | The level at which to log, refer to the LogLevel enum exported by the package | ❌ | |
| pollingInterval | How often to poll status and check apis, this value is in milliseconds | ❌ | |
| maxPollingAttemptsBeforeTimeout | The source to associate your onchain activity with, should be set to a domain | ❌ |
import {
createClient,
convertViemChainToRelayChain,
MAINNET_RELAY_API,
} from "@relayprotocol/relay-sdk";
import { mainnet } from "viem/chains";
createClient({
baseApiUrl: MAINNET_RELAY_API,
source: "YOUR.SOURCE",
chains: [convertViemChainToRelayChain(mainnet)],
});This documentation is built and hosted on Mintlify, a developer documentation platform.