SDKs
Willow has official, open-source SDKs in six languages, plus a LangChain integration. Every one verifies cryptographic proofs for you, so the data your code receives is already Willow verified.
Available SDKs
Section titled “Available SDKs”| Language | Package | Repository |
|---|---|---|
| TypeScript / JavaScript | @willow-network/sdk | willow-sdk-typescript |
| Python | willow-sdk | willow-sdk-python |
| Rust | willow-sdk | willow-sdk-rust |
| Go | github.com/willow-network/willow-go | willow-sdk-go |
| Swift | Willow | willow-sdk-swift |
| React Hooks | @willow-network/react-hooks | willow-sdk-react-hooks |
| LangChain | willow-langchain | willow-sdk-langchain |
Install
Section titled “Install”# TypeScript / JavaScriptnpm install @willow-network/sdk
# Pythonpip install willow-sdk
# Gogo get github.com/willow-network/willow-go# Rust — Cargo.toml[dependencies]willow-sdk = "0.1"Quick examples
Section titled “Quick examples”TypeScript
Section titled “TypeScript”import { WillowClient, generateWallet, createDidFromWallet } from '@willow-network/sdk';
const wallet = generateWallet();const did = createDidFromWallet(wallet);
const client = new WillowClient({ apiUrl: 'https://api.willow.tech', did: did.id, privateKey: wallet.privateKey,});await client.init();
// Store and read back — the read is proof-verified locally.await client.store('my-subgrove', 'users', 'user-1', { name: 'Alice' });const data = await client.get('my-subgrove', 'users', 'user-1');Python
Section titled “Python”from willow import WillowClient, generate_did
async with WillowClient("https://api.willow.tech") as client: did_info = generate_did() await client.register_did(did_info["did_document"]) await client.authenticate( did_info["did"], did_info["private_key"], did_info["public_key_id"] )
await client.data.store("my-subgrove", "users", "user-1", {"name": "Alice"}) result = await client.data.get("my-subgrove", "users", "user-1")use willow_sdk::{WillowClient, auth::generate_did, types::SignatureAlgorithm};
#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = WillowClient::new("https://api.willow.tech").await?; let did = generate_did(SignatureAlgorithm::Ed25519)?; client.register_did(&did.did_document).await?; client .authenticate(&did.did, &did.private_key_hex(), &did.public_key_id) .await?; Ok(())}What “verification built in” means
Section titled “What “verification built in” means”- Reads are checked against Merkle proofs over Willow’s committed state.
- If a proof fails, the SDK errors instead of returning the data.
- The TypeScript SDK verifies in pure TypeScript — no WASM — so it runs in the browser and in Node. Other SDKs verify natively.
For how the proofs work, see Verification.