TypeScript SDKs for privacy-preserving confidential contract operations using Fully Homomorphic Encryption on Zama Protocol. Shield, transfer, and unshield tokens with encrypted balances — no one sees your amounts on-chain.
| Package | Description |
|---|---|
@zama-fhe/sdk |
Core SDK — confidential contract operations, FHE relayer, contract call builders, viem/ethers adapters, Node.js worker pool |
@zama-fhe/react-sdk |
React hooks wrapping the core SDK via @tanstack/react-query, with viem/ethers/wagmi sub-paths |
# Core SDK (vanilla TypeScript)
pnpm add @zama-fhe/sdk
# or: npm install @zama-fhe/sdk / yarn add @zama-fhe/sdk
# React hooks
pnpm add @zama-fhe/react-sdk @tanstack/react-query
# or: npm install @zama-fhe/react-sdk @tanstack/react-query / yarn add @zama-fhe/react-sdk @tanstack/react-queryFull documentation — tutorials, API reference, integration guides, and examples — is available via a local preview:
pnpm install
pnpm docs:previewThe docs will eventually be published to docs.zama.org. Until then, serve them locally with the command above.
See CONTRIBUTING.md for the full contributor guide (branching, PRs, code style, architecture).
- Node.js >= 22
- pnpm >= 10
pnpm installpnpm build # Build all (sdk first, then react-sdk)
pnpm build:sdk # Build core SDK only
pnpm build:react-sdk # Build React SDK onlypnpm test # Watch mode
pnpm test:run # Single run
pnpm typecheck # Type checking
pnpm lint # Linting
pnpm format:check # Formatting checkpnpm submodule:init # Initialize hardhat submodule (first time)
pnpm hardhat:install # Install hardhat dependencies
pnpm e2e:test # Run E2E tests (auto-starts hardhat + next dev)
pnpm e2e:test:ui # Playwright UI modeThis repository includes an opt-in Claude Code configuration in claude-setup/settings.json. It provides:
- Auto-allowed commands —
pnpm build,pnpm test,pnpm lint,pnpm typecheck,pnpm format, and git diff variants run without prompting. - Denied reads —
.envfiles and.next/are blocked to prevent accidental secret exposure. - Ask-before-running — destructive commands (
rm), remote pushes (git push), and release commands require explicit approval. - Post-edit hooks — every file write/edit automatically triggers
pnpm typecheck,pnpm lint, andpnpm format. - Custom skills — custom skills required for good development practices to contribute to this repo.
To use it, install Claude Code and run pnpm setup:claude.