Installing the SDK
The @lit-protocol/lit-node-client
package forms the core of the Lit SDK, providing essential functionality for both Node.js and browser environments. This page guides you through its installation process.
Installation with npm or Yarn
- npm
- yarn
npm install @lit-protocol/lit-node-client
yarn add @lit-protocol/lit-node-client
Node.js
The minimum required version of Node.js is v19.9.0 because of the requirement for crypto support.
Browser
Setting up the Lit SDK in a browser environment is very similar to using it in Node.js, but there are a few differences. One key difference is the need for polyfills. These may include the buffer
, crypto
, vm
, and stream
libraries, but exactly which ones you need depends on the framework you're using. To resolve these issues, an example of polyfilling for Vite can be found here.