This page explains how to install and use the Chainlink Library in your projects.
If you're new to smart contract development and want a step-by-step guide, try out our Beginner Walkthrough
If you already have a project, you can add Chainlink to it by using the following package managers.
Install using NPM
npm install @chainlink/contracts --save
Install using Yarn
yarn add @chainlink/contracts
If you're creating a new project from scratch, these commands will help you set up your project to interact with Chainlink.
npm install --save-dev hardhat
Then, clone the boilerplate repository.
git clone https://github.com/smartcontractkit/chainlink-hardhat-box cd chainlink-hardhat-box
Install Brownie with pip:
pip install eth-brownie
With Brownie installed, run the commands below to open a Brownie project into a new directory.
mkdir MyChainlinkProject cd MyChainlinkProject/ brownie bake chainlink-mix cd chainlink-mix
Environment variables are required when working with Brownie. Learn how to set environment variables.
Install Truffle with NPM:
npm install truffle -g
Once installed, unbox the Chainlink box.
mkdir MyChainlinkProject cd MyChainlinkProject/ truffle unbox smartcontractkit/box
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 Price 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.
Updated 7 days ago
Learn how to consume crypto prices, random numbers and how to call any API from your smart contracts
|Introduction to Price Feeds|
|Introduction to Chainlink VRF|
|Introduction to Using Any API|