Install Frameworks

Starter Kits Logos

This page explains how to install and use the Chainlink Library in your projects, either manually or via the user of the Chainlink Starter Kits.

Install into Existing Projects

Chainlink is supported by Hardhat, Brownie, Truffle and other frameworks.

If you already have a project, you can add Chainlink to it by using the following package managers.

NPM

Install using NPM:

npm install @chainlink/contracts --save

Yarn

Install using Yarn:

yarn add @chainlink/contracts

Create a New Project

If you’re creating a new project from scratch, these commands will help you set up your project to interact with Chainlink tools and features via the use of our Starter Kits.

Hardhat Starter Kit

To learn more about Hardhat, see the Hardhat Documentation.

Clone the starter kit. The starter kit includes Hardhat, so you don’t need to install it separately.

git clone https://github.com/smartcontractkit/hardhat-starter-kit
cd hardhat-starter-kit

For instructions on how to use the starter kit, refer to the Hardhat starter kit README.

For more details on how to use Chainlink with Hardhat, see our blog post about How to use Hardhat with Chainlink.


Brownie Starter Kit

Before you begin, install Brownie.

With Brownie installed, run the commands below to open a Brownie project in a new directory.

mkdir MyChainlinkProject
cd MyChainlinkProject/
brownie bake chainlink-mix
cd chainlink-mix

For instructions on how to use the starter kit, refer to the Brownie starter kit README.

For more details on how to use Chainlink with Brownie, see the Develop a DeFi Project Using Python blog post.


Truffle Starter Kit

Before you begin, install Truffle with NPM:

npm install truffle -g

Once installed, unbox the Truffle Starter Kit:

mkdir MyChainlinkProject
cd MyChainlinkProject/
truffle unbox smartcontractkit/truffle-starter-kit

For instructions on how to use the starter kit, refer to the Truffle starter kit README.

For more details on how to use Chainlink with Truffle, see our blog post about Using Truffle to interact with Chainlink Smart Contracts.


DappTools Starter Kit

To learn more about DappTools, refer to the DappTools Documentation.

  1. Install Dapp tools using the Installation instructions in the Dapp tools GitHub repository.

  2. After you install the tools, clone the starter kit and install the dependencies:

    git clone https://github.com/smartcontractkit/dapptools-starter-kit
    cd dapptools-starter-kit
    make # This installs the project's dependencies.

For instructions on how to use the starter kit, refer to the DappTools starter kit README.

For more details on how to use Chainlink with DappTools, see the How To Use DappTools blog post.


Foundry Starter Kit

To learn more about Foundry, refer to the Foundry Documentation.

  1. Install Foundry using the Installation instructions on GitHub.io.

  2. After you install Foundry, clone the starter kit and install the project dependencies:

    git clone https://github.com/smartcontractkit/foundry-starter-kit
    cd foundry-starter-kit
    make # This installs the project's dependencies.

For instructions on how to use the starter kit, refer to the Foundry starter kit README.


Using Chainlink Contracts

Once you have the Chainlink library installed, you can leverage the Chainlink ecosystem.

If you’re interested in retrieving up to date crypto prices in your contracts, learn more about our Data Feeds.

If you need to consume randomness in your contracts, learn about Chainlink VRF.

And if you want your contracts to retrieve data from off-chain APIs, learn about Using Any API.

Testing Chainlink Contracts

See our blog post on Testing Chainlink Smart Contracts or watch the Chainlink Hackathon Workshop.

Tests samples can be found on Hardhat Starter Kit and Truffle Starter Kit respectively.

Whats Next

Stay updated on the latest Chainlink news