> ## Documentation Index
> Fetch the complete documentation index at: https://circle-devdocs-test-ai-codegen-component.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started with Smart Contract Platform - Node.js

Use the Node.js SDK to interact with Smart Contract Platform APIs, which allow
you interact with smart contracts on the blockchain using the Developer Services
platform.

This page provides short examples of how to install and use the Smart Contract
Platform SDK. For complete examples, see the [Sample Projects](/sample-projects)
page. For more information see the
[Smart Contract Platform documentation](/contracts).

## Prerequisites

To successfully use the Smart Contract Platform SDK, you need the following:

* Have [Node.js](https://nodejs.org) and npm installed. Circle recommends Node
  16 or higher.
* Have an active [Circle Developer Account](https://console.circle.com/).
* [Generate an API key](https://developers.circle.com/w3s/web3-services-api-client-keys-auth)
  to use in requests to the Circle API.
* [Generate an entity secret](https://developers.circle.com/wallets/dev-controlled/register-entity-secret)
  to use in requests with the Smart Contract Platform SDK.

## Install the SDK

Use the following commands to install the SDK. You can
[view the package information on the npm site](https://www.npmjs.com/package/@circle-fin/smart-contract-platform).

<CodeGroup>
  ```shell npm theme={null}
  npm install @circle-fin/smart-contract-platform --save
  ```

  ```shell yarn theme={null}
  yarn add @circle-fin/smart-contract-platform
  ```
</CodeGroup>

## Smart Contract Platform client

To start using the SDK, you first need to configure a client. Import the
`initiateSmartContractPlatformClient` factory from the SDK, and then initialize
the client using your API key and entity secret.

### Import the client

The following example shows how to import the client and configure it to use
your API key and entity secret:

<CodeGroup>
  ```javascript CommonJS theme={null}
  const {
    initiateSmartContractPlatformClient,
  } = require("@circle-fin/smart-contract-platform");
  const client = initiateSmartContractPlatformClient({
    apiKey: "<your-api-key>",
    entitySecret: "<your-entity-secret>",
  });
  ```

  ```javascript ES Module theme={null}
  import { initiateSmartContractPlatformClient } from "@circle-fin/smart-contract-platform";
  const client = initiateSmartContractPlatformClient({
    apiKey: "<your-api-key>",
    entitySecret: "<your-entity-secret>",
  });
  ```
</CodeGroup>

### Deploy a smart contract

The following example shows how to deploy a smart contract using the client:

```javascript Javascript theme={null}
const response = await client.deployContract({
  name: "First Contract",
  description: "My first hello world contract",
  walletId: "004735f6-d9fc-44f8-933c-672cdf3d240d",
  abiJson:
    "[\n\t{\n\t\t'inputs': [],\n\t\t'stateMutability': 'nonpayable',\n\t\t'type': 'constructor'\n\t},\n\t...",
  bytecode: "0x60806040523480156200001157600080fd5b50604051806040...",
  constructorParameters: ["TICK", 10000],
  feeLevel: "MEDIUM",
});
console.log(response.data);
```

### Client configuration options

## Client configuration options

The client for the Smart Contract Platform SDK accepts the following
configuration parameters:

| **Option**     | **Required?** | **Description**                                                                                        |
| -------------- | ------------- | ------------------------------------------------------------------------------------------------------ |
| `apiKey`       | Yes           | The API key used to authenticate requests to the Circle API.                                           |
| `entitySecret` | Yes           | Your configured entity secret.                                                                         |
| `storage`      | No            | Optional custom storage solution for persisting data. If not provided, the SDK uses in-memory storage. |
