Skip to main content
The CDR SDK (@piplabs/cdr-sdk) provides a TypeScript client for interacting with Story’s Confidential Data Rails system. It handles threshold encryption, vault management, and on-chain access control.
LanguagePackageGitHub
TypeScript npm Code

Step-by-Step Guide

Learn CDR through a series of tutorials with the CDR SDK Integration Guide.

CDRClient

The main entry point. Provides access to three sub-clients:
import { CDRClient } from "@piplabs/cdr-sdk";

const client = new CDRClient({
  network: "testnet", // or "mainnet"
  publicClient, // viem PublicClient
  walletClient, // optional viem WalletClient
});

client.observer; // read-only queries
client.uploader; // encryption & vault allocation
client.consumer; // decryption & read requests

Sub-Clients

Observer

Read-only queries for vault data, fees, and DKG state.

Uploader

Encrypt data and write it to CDR vaults.

Consumer

Request decryption and recover encrypted data.

Crypto Utilities

Crypto

Low-level TDH2 and ECIES cryptographic primitives.