Introduction
The Sage Protocol SDK provides developers with a complete toolkit for building decentralized applications on Sui that leverage Sage’s social primitives and economic incentives. This SDK handles all the complexity of blockchain interactions, letting you focus on building engaging user experiences.
Installation
Install the SDK:
Core Architecture
The Sage SDK offers two integration approaches:
Vanilla Client
Direct programmatic access to all Sage Protocol functions. Ideal for server-side applications, custom integrations, or when you need fine-grained control over transaction management.
React Wrapper
Provides React hooks and context providers that simplify state management and transaction handling in React applications. Built on top of the vanilla client with additional React-specific optimizations.
Both approaches support testnet and mainnet deployments, allowing you to develop and test before going to production.
Quick Start Example
Here’s a basic setup showing both approaches:
Vanilla Client Setup:
React Wrapper Setup:
Prerequisites
Network Selection
Choose testnet for development or mainnet for production.
Basic Sui Knowledge
Familiarity with Sui’s object model and transaction signing helps but isn’t required.
Key Concepts
Application Isolation
Content and channels are isolated per application, while user identities remain global across all Sage applications. This means users maintain consistent profiles and social graphs while experiencing app-specific content.
Transaction Patterns
All write operations return transactions that must be signed and executed by your users’ wallets. The SDK handles transaction construction while your application manages the signing flow:
Error Handling
The SDK uses a consistent result pattern across all operations. Check the ok property before proceeding:
Use Cases
The Sage SDK enables various decentralized social applications:
- Community Platforms: Reddit-style discussion forums with tokenized engagement
- Social Networks: Twitter-like platforms with user-owned profiles and relationships
- Creator Platforms: Medium-style publishing with direct creator-audience connections
- Gaming Communities: Discord-like spaces with integrated reputation and rewards
- Professional Networks: LinkedIn-style platforms with verifiable professional identities
What’s Next
This documentation covers the three core primitives you’ll work with:
- Channels: Community spaces where users can post and interact
- Posts: Content creation, commenting, and engagement
- Users: Identity management, social connections, and profiles
Each section provides comprehensive examples and patterns for both vanilla client and React implementations.