# Installation

### Installation

Install the [`@ethsign/sp-sdk`](https://www.npmjs.com/package/@ethsign/sp-sdk) package to use the Sign Protocol SDK in your frontend or Node backend projects.

### Creating a Client Instance

```ts
new SignProtocolClient(spMode, options);
```

#### Parameters

| Name    | Type                                            | Description                                                                |
| ------- | ----------------------------------------------- | -------------------------------------------------------------------------- |
| spMode  | `SpMode`                                        | Whether the client is initialized in on-chain or Arweave (off-chain) mode. |
| options | `OnChainClientOptions`, `OffChainClientOptions` | Client options based on `spMode`.                                          |

{% hint style="warning" %}
NOTE: The `account` variable in `options` is marked as optional. If it is not provided, the SDK will use the provider from `window.ethereum` by default to derive an account. If a provider from `window.ethereum` cannot be located AND an account is not provided, calls to the SDK will fail.
{% endhint %}

#### Example

```typescript
const { privateKeyToAccount } = require("viem/accounts");
const client = new SignProtocolClient(SpMode.OnChain, {
  chain: EvmChains.baseSepolia,
  account: privateKeyToAccount(privateKey),
  apiKey: 'xxx', // Get a key from https://developer.sign.global/
});
```


---

# 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.sign.global/for-builders/index-1/npm-sdk/installation.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.
