npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xhilo/pi-sdk

v0.2.23

Published

A simplified SDK for Pi Network integration with React frontend and Node.js backend support - no provider needed!

Readme

Pi SDK

A unified SDK for Pi Network integration with React frontend and Node.js backend support.

🏗️ Architecture

The Pi SDK uses a configuration-driven architecture for backend operations:

  • User-to-App (U2A) Payments: Uses piPlatformFetchClient and userToAppPayment actions
  • App-to-User (A2U) Payments: Uses pi-backend-sdk and appToUserPayment actions
  • Configuration Required: All backend functions require explicit configuration parameters
  • No Environment Dependencies: SDK functions don't read from environment variables
  • Consistent Error Handling: All actions return standardized PiOperationResult types
  • Type Safety: Full TypeScript support with comprehensive type definitions
  • Security: Optional access token validation for enhanced security

🚀 Quick Start

# Install the SDK
npm install @xhilo/pi-sdk

# Create a new Next.js app with template
npx create-next-app@latest my-pi-app --template @xhilo/pi-sdk/nextjs

📚 Documentation

Complete documentation is available at: pi-sdk-docs

Essential Guides

Quick Links

🎯 Key Features

React Hooks

  • useXhiloPiNetwork - Core Pi Network integration with robust state management
  • usePiPayments - Complete payment lifecycle management with backend integration
  • usePiSimplePayments - Simplified payment processing using createAndMakePayment
  • usePiAds - Ads functionality (currently stub implementation)
  • usePiAdsSimple - Simple ads functionality (currently stub implementation)

Backend Actions

  • processA2UWithdrawalAction - Server-side A2U payment processing
  • createAndMakeA2UPayment - High-level A2U payment helper
  • approvePaymentAction - Server-side U2A payment approval
  • completePaymentAction - Server-side U2A payment completion
  • verifyRewardedAdAction - Ads verification and reward processing
  • getAdEligibilityAction - Check user ad eligibility
  • getUserAdStatsAction - Get user ad statistics
  • piPlatformFetchClient - Pi Platform API integration utilities

Configuration Management

The SDK requires explicit configuration - no environment variable dependencies:

// Backend Configuration
const piBackendConfig = {
  apiKey: process.env.PI_API_KEY!,
  privateSeed: process.env.PI_WALLET_PRIVATE_SEED!
}

// Platform Configuration  
const piPlatformConfig = {
  apiKey: process.env.PI_API_KEY!
}

// All backend functions require config
await processA2UWithdrawalAction(args, piBackendConfig)
await approvePaymentAction(args, piPlatformConfig)

Environment Variables (for application code only):

# Required for your application
PI_API_KEY=your_pi_api_key
PI_WALLET_PRIVATE_SEED=your_wallet_private_seed

🔗 Links

📞 Support & Contact

  • Discord: realhavenn
  • Telegram: realhavenn
  • X (Twitter): realhavenn
  • GitHub: Nanasark

Support Channels:

📄 License

MIT License - see LICENSE file for details.


Built with ❤️ for the Pi Network community by realhavenn