Skip to main content

daocafe-sdk

The official TypeScript SDK for DAO.CAFE - providing type-safe access to governance data from the CreateDAO protocol.

React Hooks

TanStack Query integration for seamless data fetching

Query Functions

Promise-based API for Node.js and vanilla JS

TypeScript Types

Full type definitions for all entities

Examples

Real-world code examples

Features

FeatureDescription
🔍 Type-safeFull TypeScript support with generated types
⚛️ React HooksTanStack Query integration with caching and refetching
🚀 Tree-shakableOnly bundle what you use
📦 Zero ConfigPre-configured to work with the DAO.CAFE endpoint
🔄 Real-time ReadyBuilt-in caching and background refetching

Installation

Peer Dependencies (for React hooks)

If you plan to use the React hooks, install these peer dependencies:

Quick Start

With React Hooks

With Async Functions (Node.js / Vanilla JS)

Supported Networks

NetworkChain IDStatus
Ethereum1✅ Supported
Sepolia Testnet11155111✅ Supported

ID Formats

The SDK uses composite IDs for all entities:
EntityID FormatExample
DAOchainId_governorAddress11155111_0xf51C4b7b...
ProposalchainId_governor_proposalId11155111_0xf51C4b7b..._12345
VotechainId_governor_proposalId_voter11155111_0xf51C...._12345_0xAbc...
DelegatechainId_tokenAddress_delegatorAddress11155111_0xcfCf..._0xAbc...
TokenHolderchainId_tokenAddress_holderAddress11155111_0xcfCf..._0xAbc...

What’s Next?

React Hooks

Deep dive into all available React hooks

Real-World Examples

Build a DAO dashboard from scratch