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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openpets/whop

v1.0.0

Published

Comprehensive plugin for interacting with the Whop API - manage products, payments, users, companies, memberships, and more

Readme

Whop API Plugin for OpenPets

A comprehensive OpenPets plugin for interacting with the Whop API - manage products, payments, users, companies, memberships, and more.

Features

  • Products Management: List, retrieve, and manage products
  • Payments Processing: List payments, get payment details, and analyze transaction data
  • User Management: Get user information and check access permissions
  • Company Operations: Retrieve company details and manage business data
  • Membership Tracking: List and manage user memberships
  • Plan Management: Handle subscription plans and pricing
  • App Development: List and manage Whop applications
  • Fee Analysis: Get detailed fee information for payments

Quick Start

1. Environment Setup

Create a .env file in the whop directory:

WHOP_API_KEY=your_api_key_here
WHOP_APP_ID=your_app_id_here  # Optional, for app development

2. Get Your API Key

  1. Go to Whop Developer Dashboard
  2. Create either a Company API Key (for your own data) or App API Key (for building apps)
  3. Copy the API key to your .env file

3. Test Connection

cd pets/whop
opencode run "test whop connection" --format json --print-logs

Available Tools

Connection & Testing

  • whop-test-connection - Test API connection and get account info

Products

  • whop-list-products - List products with filtering options
  • whop-get-product - Get detailed product information

Payments

  • whop-list-payments - List payments with comprehensive filtering
  • whop-get-payment - Get specific payment details
  • whop-list-payment-fees - Get fee breakdown for payments

Users

  • whop-get-user - Get user information by ID or username
  • whop-check-user-access - Check if user has product access

Companies

  • whop-get-company - Get company information

Memberships

  • whop-list-memberships - List memberships with status filtering
  • whop-get-membership - Get specific membership details

Plans

  • whop-list-plans - List subscription plans

Apps

  • whop-list-apps - List applications (requires app API key)

Usage Examples

List Products for a Company

opencode run "list all products for company biz_1234567890" --format json

Get Recent Payments

opencode run "list recent payments for company biz_1234567890 with limit 10" --format json

Check User Access

opencode run "check if user_123456 has access to product_7890" --format json

Get Payment Details

opencode run "get payment details for pay_abcdef123456" --format json

API Key Types

Company API Keys

  • Use for accessing your own company's data
  • Can access connected account data (for platforms)
  • Recommended for most use cases

App API Keys

  • Use for building applications
  • Can access data from companies that installed your app
  • Requires app permissions setup

Required Permissions

Different endpoints require different permission scopes:

  • Products: access_pass:basic:read
  • Payments: payment:basic:read, plan:basic:read, member:basic:read
  • Users: Varies by endpoint
  • Companies: company:basic:read
  • Memberships: membership:basic:read

Check the Whop API Documentation for detailed permission requirements.

Response Format

All tools return JSON responses with consistent structure:

{
  "success": true,
  "data": { /* response data */ },
  "message": "Operation completed successfully"
}

Error responses:

{
  "success": false,
  "error": "Error message",
  "details": { /* additional context */ }
}

Filtering Options

Products

  • visibility: Filter by product visibility
  • productType: Filter by product type
  • order: Sort by various fields
  • direction: Sort direction (asc/desc)

Payments

  • status: Payment status filter
  • substatus: Payment substatus filter
  • currency: Currency filter
  • includeFree: Include free transactions

Memberships

  • status: Membership status filter

Error Handling

The plugin includes comprehensive error handling:

  • Connection errors: Network issues, invalid endpoints
  • Authentication errors: Invalid or missing API keys
  • Permission errors: Insufficient API permissions
  • Validation errors: Invalid parameters

Development

Local Testing

  1. Make changes to index.ts
  2. Test with OpenCode commands
  3. Check logs for debugging information

Building

pets build whop

Publishing

pets publish whop

Troubleshooting

Common Issues

  1. "Not configured" error

    • Check that WHOP_API_KEY is set in .env
    • Verify the API key is valid
  2. Permission denied errors

    • Ensure your API key has required permissions
    • Check if you're using the right key type (company vs app)
  3. Invalid company/product IDs

    • Verify IDs are in correct format (biz_xxx, prod_xxx, etc.)
    • Check that resources exist and are accessible

Debug Mode

Enable debug logging by setting log level in your environment:

WHOP_LOG_LEVEL=debug

API Reference

For detailed API documentation, see:

Support

  • Documentation: Check this README and API docs
  • Issues: Report bugs via GitHub issues
  • Community: Join the OpenPets Discord community

License

This plugin is part of the OpenPets ecosystem and follows the same license terms.