> ## 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.

# Testnet Support

> How to Utilize Testnets on Relay

export const Chains = ({env, id}) => {
  const key = `chains-${env}`;
  if (typeof window === "undefined") {
    return null;
  }
  if (typeof document === "undefined") {
    return null;
  }
  if (!window[key]) {
    window[key] = {
      fetching: false,
      data: null,
      observer: null
    };
  }
  if (!window[key].fetching) {
    const appendChains = data => {
      const rootElement = document.getElementById(id);
      if (!rootElement) {
        return;
      }
      const rows = data.slice().sort((a, b) => a.displayName.localeCompare(b.displayName)).map(chain => {
        return `<tr key=${chain.id}>
          <td>
            <div style="display: flex; align-items: center; gap: 8px; text-transform: capitalize;">
              <img class="chain-icon chain-icon-light" src="https://assets.relay.link/icons/square/${chain.id}/light.png" alt="" loading="lazy" onerror="this.style.display='none'" style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; margin: 0;" />
              <img class="chain-icon chain-icon-dark" src="https://assets.relay.link/icons/square/${chain.id}/dark.png" alt="" loading="lazy" onerror="this.style.display='none'" style="width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; margin: 0;" />
              <span>${chain.displayName}</span>
            </div>
          </td>
          <td>${chain.id}</td>
          <td>${chain.tokenSupport}</td>
        </tr>`;
      });
      rootElement.innerHTML = `<div id="${id}-marker"></div>${rows.join("")}`;
      if (!window[key].observer) {
        let observer = new MutationObserver(function (mutations) {
          if (!document.getElementById(`${id}-marker`)) {
            appendChains(data);
          }
        });
        observer.observe(document.body, {
          childList: true,
          subtree: true
        });
        window[key].observer = observer;
      }
    };
    const fetchChains = async () => {
      try {
        if (window[key].fetching) return;
        window[key].fetching = true;
        window[key].data = null;
        const response = await fetch(env === "testnets" ? "https://api.testnets.relay.link/chains" : "https://api.relay.link/chains");
        const data = await response.json();
        window[key].fetching = false;
        window[key].data = data.chains;
        appendChains(data.chains);
      } catch (e) {
        window[key].fetching = false;
        window[key].data = false;
      }
    };
    if (window[key].data) {
      appendChains(window[key].data);
    } else {
      fetchChains();
    }
  }
  return <table className="relay-table" style={{
    width: "100%"
  }}>
<thead style={{
    borderBottom: "1px solid rgb(227 226 230)"
  }}>
<tr style={{
    textAlign: "left"
  }}>
<th>Chain</th>
<th>Chain ID</th>
<th>Supported Tokens</th>
</tr>
</thead>
<tbody id={id}></tbody>
</table>;
};

Relay supports a variety of testnet and tokens. We recommend using testnets and their tokens as a way to test bridging with no cost. Our testnet chains are full
supported across all of our tools: APIs, SDK, and UI Kit. Feel free to explore the chains offered below. For the latest list, please explore our
[Testnets Supported Chains](/references/api/api_resources/supported-chains#testnets).

<Tip>**Testnets are not recommended for testing swaps.** Testnets typically lack real DEX liquidity making testnet swaps fail. We recommend using
inexpensive L2s like Base or Arbitrum to test swapping. The cost of gas will outweight the time required to debug testnet-specific issues like illiquidity.</Tip>

## Testnets Supported

You can see all the testnets we support in the table below. You can also query our API to get a JSON of the
supported testnets: [https://api.testnets.relay.link/chains](https://api.testnets.relay.link/chains) The API response will also return chain IDs and other relevant information.

<Chains id="testnetChains" env="testnets" />

## API Support

To access testnets with our API, make sure to use the correct base URL: `https://api.testnets.relay.link` By using this base URL, you'll be able
to bridge, swap, and transact on testnets Relay supports. To get started, check out the [API documentation](/references/api/overview).

## SDK Support

To access testnets with our SDK, make sure to use the correct base URL: `https://api.testnets.relay.link` You'll pass this base URL in
the `baseApiUrl` parameter when creating the client. To get started, check out the [SDK documentation](/references/relay-kit/sdk/installation).

## UI Kit Support

To access testnet with our UI kit, make sure to pass the testnet chain you want e.g. `base sepolia`, `sepolia`, etc.
To get started, check out the [UI Kit documentation](/references/relay-kit/overview).
