# Initializing SDK

### Setting Up the SDK

**SDK Setup**:

```javascript
const apiKey = process.env.API_API; //if stored in env variables
const chainEx = new ChainEx(apiKey);

//returns smart contract wallet address and initializes the SDK
const smartAccount = await chainEx.initialize(provider, configParams);
```

Begin by setting up the ChainEx SDK using your API key. Replace `provider` and `configParams` with the specifics of your setup to ensure the correct SDK configuration.

#### configParams

Adjust `ClientParams`, the configuration interface for the SDK, as follows:

* `chainId` (number): Designate the chain ID for the Ethereum network (1).
* `privateKey` (string, optional): If necessary, include a private key for signing.
* `rpcUrl` (string, optional): Specify the Ethereum RPC endpoint URL.
* `isSponsored` (boolean, optional): Define if the transaction is sponsored.
* `paymasterUrl` (string, optional): Include the URL for the paymaster service.
* `paymasterProvider` (string, optional): Choose a paymaster type.
* `bundlerUrl` (string, optional): Point out the URL for the bundler service.

Customize these parameters according to the needs of your application.

{% hint style="info" %}
We will be coming up with our dedicated paymaster soon.
{% endhint %}


---

# 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://chainex.gitbook.io/whitepaper/sdk-integration-docs/initializing-sdk.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.
