Matic.js is made up of a main library and an Ethereum library:
The main library has the core logic and provides different APIs. The user interacts mostly with this library.
npm i @maticnetwork/maticjs
The Ethereum library allows us to use any favorite ether library. It is injected into maticjs using plugins.
matic.js supports two popular library -
npm install @maticnetwork/maticjs-web3
npm install @maticnetwork/maticjs-ethers