Clarinet JS SDK Overview

The Clarinet JS SDK is a JavaScript library used to write unit tests for Clarity smart contracts.

The Clarinet JS SDK allows you to write unit tests for your Clarity smart contracts. You can theoretically use any JavaScript test framework, but the SDK supports Vitest out of the box. This SDK leverages simnet, a simulated network that offers a rapid feedback loop for initial testing.

Here is a non-exhaustive list of some of simnet's use-cases:

  • Call public and read-only functions from smart contracts
  • Get Clarity maps or data-var values
  • Get contract interfaces (available functions and data)
  • Write unit tests for Clarity smart contracts
Requirements

The SDK requires Node.js >= 18.0 and NPM to be installed.

Guides