Skip to main content

Installation

Prerequisites

  • Node.js >= 18.0.0
  • pnpm (recommended) or npm

SDK

Install the core SDK in your project:

Peer Dependencies

The SDK has peer dependencies for Lit Protocol integration. If you plan to use off-chain (Tier 3) rules, install them as well:

Required Dependencies

The SDK requires viem for Ethereum interactions:

CLI

Install the CLI globally:
Verify the installation:

Smart Contracts

Install the Solidity contracts as a dependency for your own contracts:
Then import the contracts in your Solidity code:
If using Foundry with the npm package, add a remapping to your remappings.txt:

Local Development

If you’re developing or extending the smart contracts themselves, you’ll need Foundry:
Then install contract dependencies:

Lit Actions

Install the Lit Actions package to get the pre-built policy evaluator bundle for off-chain rule evaluation:
The package includes:
  • Pre-built bundle at build/policyEvaluator.action.js — upload this to IPFS and pass the CID to the SDK’s LitClient
  • Source rules in src/rules/ — use as reference or starting points for custom rule implementations

Monorepo Setup (Contributing)

To work on PolicyKit itself:
Run tests across all packages:

Next Steps

Quickstart

Build and deploy your first policy.