> ## Documentation Index
> Fetch the complete documentation index at: https://policykit.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Overview

> Overview of the @policy-kit/sdk package

# SDK Overview

The `@policy-kit/sdk` package is the primary interface for building, deploying, and managing policies. It provides a collection of clients and utilities that work together.

## Package Exports

```typescript theme={null}
import {
  // Builders
  PolicyBuilder,

  // High-level client
  PolicyKit,

  // Low-level clients
  PolicyEngineClient,
  IPFSClient,
  LitClient,

  // Testing
  PolicySimulator,

  // Encoding
  PolicyEncoder,

  // Types
  Policy,
  OnChainRule,
  OffChainRule,
  FailMode,
  RuleType,
  EvaluationReport,
} from "@policy-kit/sdk";
```

## Components

<CardGroup cols={2}>
  <Card title="PolicyBuilder" icon="hammer" href="/sdk/policy-builder">
    Fluent API for constructing policies with compile-time validation.
  </Card>

  <Card title="PolicyKit Client" icon="briefcase" href="/sdk/policy-kit-client">
    High-level client that orchestrates deployment and management.
  </Card>

  <Card title="Policy Simulator" icon="flask" href="/sdk/policy-simulator">
    Local evaluation engine for testing policies without deploying.
  </Card>

  <Card title="IPFS Client" icon="database" href="/sdk/ipfs-client">
    Pin and retrieve policy documents from IPFS.
  </Card>

  <Card title="Lit Client" icon="bolt" href="/sdk/lit-client">
    Integration with Lit Protocol for off-chain rule evaluation.
  </Card>
</CardGroup>

## Quick Reference

### Building a Policy

```typescript theme={null}
import { PolicyBuilder } from "@policy-kit/sdk";

const policy = new PolicyBuilder("my-policy")
  .allowTargets(["0x..."])
  .maxValue(parseEther("1"))
  .setFailMode("closed")
  .build();
```

### Deploying a Policy

```typescript theme={null}
import { PolicyKit } from "@policy-kit/sdk";

const pk = new PolicyKit({ publicClient, walletClient, engineAddress, ipfsBackends });
const result = await pk.deployPolicy(policy);
```

### Simulating a Transaction

```typescript theme={null}
import { PolicySimulator } from "@policy-kit/sdk";

const simulator = new PolicySimulator();
const report = await simulator.evaluate(policy, txParams);
```

## Dependencies

| Dependency        | Purpose                                       |
| ----------------- | --------------------------------------------- |
| `viem`            | Ethereum client, ABI encoding, type utilities |
| `zod`             | Runtime schema validation for policies        |
| `@lit-protocol/*` | Lit Protocol integration (peer dependency)    |
