Massive overhaul to this project!
The Complete Resource for Building Pi Network Applications
Build applications that work seamlessly in both Web2 and Web3 environments
๐ View Documentation โข ๐ Get Started โข ๐ป Examples โข ๐ Migration Guide
Revolutionary Update! This handbook now includes comprehensive support for hybrid applications that provide seamless experiences across both regular browsers and Pi Browser:
- โ Smart Pi Browser Detection - Automatically detect user environment
- โ Graceful Fallbacks - Clean UI for non-Pi Browser users
- โ No Scary Popups - Better authentication flows
- โ Broader Reach - Support both Web2 and Web3 users
- โ Future-Proof - Ready for Pi Network mainstream adoption
# 1. Clone this repository
git clone https://github.com/alxspiker/Pi-Developer-Handbook.git
cd Pi-Developer-Handbook
# 2. Explore the examples
cd examples/
# 3. Check out the hybrid app guide
# Visit: wiki/Pi-Browser-DetectionNeed to upgrade your app to hybrid architecture? ๐ Migration Guide - Step-by-step upgrade instructions
| Guide | Description | Best For |
|---|---|---|
| Pi Browser Detection | Build hybrid apps for Web2 & Web3 | Essential for all new apps |
| SDK Reference | Complete Pi SDK documentation | API integration |
| Authorization | User authentication patterns | Login systems |
| Payments | Payment integration guide | Monetization |
- What is PiNet? - Web2 accessibility platform
- What is PiWallet? - Pi Network wallet system
- Mainnet vs Testnet - Network environments
| Example | Description | Technologies |
|---|---|---|
| basic-login-and-pay | Simple authentication + payments | Vanilla JS, HTML |
| python-login-pay-subscriptions | Subscription service with Flask | Python, Flask, JavaScript |
| Pi-Network-SDK-Example | Comprehensive SDK showcase | HTML, JavaScript |
All examples now include:
- ๐ Pi Browser detection
- ๐จ Fallback UI for regular browsers
- ๐ค User-initiated authentication
- ๐ณ Conditional payment flows
- ๐ก๏ธ Proper error handling
// Modern hybrid app approach
async function initializeApp() {
const isPiBrowser = await detectPiBrowser();
if (!isPiBrowser) {
// Show fallback for regular browsers
showPiBrowserRequired();
return;
}
// Only show Pi features in Pi Browser
enablePiFeatures();
}
async function handleLogin() {
try {
const auth = await Pi.authenticate(['payments'], onIncompletePaymentFound);
console.log('โ
Authentication successful:', auth);
} catch (error) {
console.error('โ Authentication failed:', error);
}
}| Aspect | Traditional | Hybrid (Recommended) |
|---|---|---|
| Browser Support | Pi Browser only | All browsers with smart fallbacks |
| User Experience | Scary popups in regular browsers | Clean, professional experience |
| Market Reach | Pi Network users only | Web2 + Web3 audiences |
| Authentication | Auto-login (poor UX) | User-initiated (better UX) |
| Payments | Hard failures | Graceful degradation |
- Pi Browser Detection - Smart detection with fallbacks
- Authentication Helpers - User-initiated login patterns
- Payment Wrappers - Conditional payment flows
- Fallback UI Generators - Professional non-Pi Browser experiences
- Works in regular browsers (Chrome, Firefox, Safari)
- Works in Pi Browser with full functionality
- No authentication popups in regular browsers
- Clear messaging for non-Pi Browser users
- Proper error handling and cleanup
We welcome contributions! Here's how you can help:
- Documentation - Improve guides and tutorials
- Examples - Add new code samples
- Bug Reports - Report issues with existing examples
- Feature Requests - Suggest new guides or improvements
๐ Contributing Guidelines - Detailed contribution instructions
- Wiki Documentation: github.com/alxspiker/Pi-Developer-Handbook/wiki
- Issues & Questions: GitHub Issues
- Pi Network: minepi.com
๐ Ready to build the future of Pi Network applications?
๐ Start with the Documentation โข ๐ป Explore Examples โข ๐ Upgrade Existing Apps
Let's build amazing Pi Network applications together!