# getAlchemyRpcUrl

> Overview of the getAlchemyRpcUrl function

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function getAlchemyRpcUrl(chainId): undefined | string;
```

Defined in: [packages/common/src/transport/chainRegistry.ts:145](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/common/src/transport/chainRegistry.ts#L145)

Gets the Alchemy RPC base URL for a given chain ID.

## Example

```ts
const rpcUrl = getAlchemyRpcUrl(1); // "https://eth-mainnet.g.alchemy.com/v2"
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `chainId`
      </td>

      <td>
        `number`
      </td>

      <td>
        The chain ID to lookup
      </td>
    </tr>

  </tbody>
</table>

## Returns

`undefined` | `string`

The Alchemy RPC base URL or undefined if not supported