Skip to main content

daocafe-sdk

The official TypeScript SDK for DAO.CAFE - type-safe access to governance data from the CreateDAO protocol, read directly from the chain via RPC. No indexer to run or pay for.

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

Server Handler

Mount the handler that reads the chain

Features

Installation

Peer Dependencies (for React hooks)

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

Mount the Server Handler

The hooks and query functions call /api/daocafe on your origin. Mount the handler there (it needs viem):
See Server Handler for other frameworks, options and how it works.

Quick Start

With React Hooks

With Async Functions (Vanilla JS)

Supported Networks

ID Formats

The SDK uses composite IDs for all entities:

What’s Next?

React Hooks

Deep dive into all available React hooks

Real-World Examples

Build a DAO dashboard from scratch