Skip to main content
Use the Node.js SDK to interact with Contracts 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 Contracts SDK. For complete examples, see the Sample Projects page. For more information see the Contracts documentation.

Prerequisites

To use the Node.js SDK, ensure you have:

Install the SDK

Use the following commands to install the SDK. You can view the package information on the npm site.

Contracts 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:

Deploy a smart contract

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

Client configuration options

The client for the Contracts SDK accepts the following configuration parameters: