Patterns & Examples
Complete working examples you can adapt for your use case
Patterns & Examples
These are complete, working applications that demonstrate Yellow SDK patterns in real code. Each example builds on the concepts from Core Concepts and Building Blocks sections.
The Examples
Simple Payment
The absolute simplest: deposit → send → withdraw. No sessions required.
Ping-Pong Session
Your first session with typed messages and event handlers
Complete Game
Full Trivia Royale: 3 players, distributed sessions, prize distribution
Error Handling
Common issues and proven recovery strategies
Progression
Level 1: Simple Payment
Complexity: ⭐☆☆☆☆ Concepts: Fund management only Use for: Understanding balances and transfers
Level 2: Ping-Pong
Complexity: ⭐⭐⭐☆☆ Concepts: Sessions, typed messages, event handlers Use for: Learning session basics
Level 3: Complete Game
Complexity: ⭐⭐⭐⭐⭐ Concepts: Everything! Use for: Real multiplayer applications
What You'll Learn
From these examples, you'll see:
✅ Fund flows from deposit through gameplay to withdrawal ✅ Distributed signing for trustless multi-party coordination ✅ Message broadcasting and handler patterns ✅ Balance verification and fund conservation ✅ Session lifecycle management ✅ Error handling for production robustness
Next Steps
After studying these patterns:
- Adapt them for your use case
- Reference Building Blocks for specific techniques
- Review Core Concepts if something is unclear