Prerequisites
- Node.js 18+
- A deployed FHE contract on a supported network (e.g. Sepolia)
- A wallet with testnet ETH
1. Install
2. Create and connect the client
Import from@cofhe/sdk/web for browser apps or @cofhe/sdk/node for Node.js scripts.
If you use Ethers.js instead of viem, see the Client Setup guide for adapter usage.
3. Encrypt and send
4. Decrypt for display
Next steps
- Client Setup — adapters, connection management, and config options.
- Encrypting Inputs — supported types, builder API, and progress callbacks.
- Permits — create, share, and manage decryption authorization.
- Decrypt to View — reveal encrypted state in your UI.
- Decrypt to Transact — decrypt with a verifiable signature for on-chain use.