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!