# Clients

Clients are libraries used to interact directly with the blockchain, for example, to deploy, call, and manage smart contracts.

LightLink is fully EVM-equivalent, and developers can use their usual Ethereum clients.

### ethers.js

To use [ethers.js](https://docs.ethers.org/v5/) in LightLink projects, you need to add LightLink's JSON RPC URL. In your project code, find this code and change the 'url' constant to:

```javascript
const url = 'https://replicator.phoenix.lightlink.io/rpc/v1';
const provider = new ethers.providers.JsonRpcProvider(url);
```

To connect with the Testnet, insert the following:

```javascript
const url = 'https://replicator.pegasus.lightlink.io/rpc/v1';
const provider = new ethers.providers.JsonRpcProvider(url);
```

### thirdweb's SDK

To connect [thirdweb SDK](https://thirdweb.com/sdk) with LightLink Mainnet, add this code to your project:

```javascript
import { LightlinkPhoenix } from "@thirdweb-dev/chains";
import { ThirdwebSDK } from "@thirdweb-dev/sdk";

// If used on the FRONTEND pass your 'clientId'
const sdk = new ThirdwebSDK(LightlinkPhoenix, {
  clientId: "YOUR_CLIENT_ID",
});
// --- OR ---
// If used on the BACKEND pass your 'secretKey'
const sdk = new ThirdwebSDK(LightlinkPhoenix, {
  secretKey: "YOUR_SECRET_KEY",
});

const contract = await sdk.getContract("0x0000000000000000000000000000000000000000");
```

To connect with the Testnet, add this code:

```javascript
import { LightlinkPegasusTestnet } from "@thirdweb-dev/chains";
import { ThirdwebSDK } from "@thirdweb-dev/sdk";

// If used on the FRONTEND pass your 'clientId'
const sdk = new ThirdwebSDK(LightlinkPegasusTestnet, {
  clientId: "YOUR_CLIENT_ID",
});
// --- OR ---
// If used on the BACKEND pass your 'secretKey'
const sdk = new ThirdwebSDK(LightlinkPegasusTestnet, {
  secretKey: "YOUR_SECRET_KEY",
});

const contract = await sdk.getContract("0x0000000000000000000000000000000000000000");
```

### web3.js

To use [web3.js](https://web3js.readthedocs.io/en/v1.10.0/) with LightLink Mainnet, initialize a new web3 object:

```javascript
const Web3 = require('web3');
const web3 = new Web3('https://replicator.phoenix.lightlink.io/rpc/v1');
```

To connect with the Testnet, use the following initialization:

```javascript
const Web3 = require('web3');
const web3 = new Web3('https://replicator.pegasus.lightlink.io/rpc/v1');
```

Other EVM-compatible clients should also work with LightLink, provided the [correct RPC node addresses](/lightlink-protocol/building-on-lightlink/live-networks.md) are used.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lightlink.io/lightlink-protocol/tools-for-developers/clients.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
