> For the complete documentation index, see [llms.txt](https://docs.ees.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ees.xyz/sdk.md).

# SDK

### Overview <a href="#overview" id="overview"></a>

The EES SDK is a Node library to interact with the EES protocol in a typescript/javascript environment. It is built with [viem](https://viem.sh/) and contains functionality that makes it easy to query data from and interact with the EES contracts among other features. The implementation can be found [here](https://github.com/victorbrevig/sub2-sdk).

Interactions requiring querying on-chain data require the user to supply a viem public client. Some functionality like executing a job or generating a sponsor signature requires the user to additionally supply a viem wallet client.

### Installation and setup <a href="#installation-and-setup" id="installation-and-setup"></a>

The SDK can be installed through npm.

```
npm i --save ees-sdk
```

After installation, the SDK contains a class called EESSDK which can be initialized as follows:

{% tabs %}
{% tab title="index.ts" %}

```typescript
import { EESSDK } from 'ees-sdk';
import { publicClient, walletClient } from "./config";

const eesSDK = new EESSDK(publicClient, walletClient);
```

{% endtab %}

{% tab title="config.ts" %}

```typescript
import { createPublicClient, createWalletClient, http, PublicClient, WalletClient } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { baseSepolia } from 'viem/chains';

export const publicClient: PublicClient = createPublicClient({
  chain: baseSepolia,
  transport: http('YOUR_RPC_URL')
}) as PublicClient;

export const walletClient: WalletClient = createWalletClient({
  account: privateKeyToAccount('YOUR_PRIVATE_KEY'),
  chain: baseSepolia,
  transport: http('YOUR_RPC_URL')
});
```

{% endtab %}
{% endtabs %}

Now you are ready to start interacting with EES!

{% hint style="danger" %}
**Warning:** Make sure to replace `YOUR_PRIVATE_KEY` and `YOUR_RPC_URL` with your own private key and RPC url. Remember to never store these in plain text in your project.&#x20;
{% endhint %}

{% hint style="info" %}
**Note:** The EES protocol is currently only deployed on the Base Sepolia network.
{% endhint %}
