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

lokicms-plugin-stripe

v1.0.0

Published

Stripe payments and subscriptions plugin for LokiCMS

Readme

Stripe Plugin for LokiCMS

Accept payments and manage subscriptions with Stripe.

Features

  • Checkout Sessions: Create payment and subscription checkout flows
  • Customer Portal: Allow customers to manage their subscriptions
  • Subscription Management: Create, update, cancel subscriptions
  • Product & Price Sync: Sync Stripe products/prices to LokiCMS entries
  • Webhook Handling: Automatic sync on Stripe events
  • MCP Tools: AI-accessible tools for payment operations

Installation

The plugin is included in LokiCMS. Enable it in plugins.json:

{
  "plugins": [
    {
      "name": "stripe",
      "enabled": true,
      "source": "local",
      "path": "./plugins/stripe",
      "settings": {
        "secretKey": "${STRIPE_SECRET_KEY}",
        "webhookSecret": "${STRIPE_WEBHOOK_SECRET}",
        "successUrl": "https://yoursite.com/checkout/success",
        "cancelUrl": "https://yoursite.com/checkout/cancel",
        "portalReturnUrl": "https://yoursite.com/account",
        "currency": "usd"
      }
    }
  ]
}

Environment Variables

STRIPE_SECRET_KEY=sk_live_... # or sk_test_... for testing
STRIPE_WEBHOOK_SECRET=whsec_...

Content Types

The plugin creates these content types to sync Stripe data:

| Content Type | Description | |--------------|-------------| | stripe-product | Products from Stripe catalog | | stripe-price | Prices (one-time or recurring) | | stripe-subscription | Customer subscriptions | | stripe-invoice | Invoices and payment records | | stripe-customer | Customer records linked to users |

API Endpoints

Base path: /api/plugins/stripe

Checkout

# Create checkout session
POST /checkout
{
  "priceId": "price_xxx",
  "customerEmail": "[email protected]",
  "mode": "subscription"
}

# Response
{
  "id": "cs_xxx",
  "url": "https://checkout.stripe.com/..."
}

Customer Portal

# Create portal session
POST /portal
{
  "customerId": "cus_xxx"
}

Products & Prices

GET /products
GET /products?active=true
GET /prices
GET /prices?productId=prod_xxx&type=recurring

Subscriptions

GET /subscriptions
GET /subscriptions/:id
POST /subscriptions/:id/cancel
POST /subscriptions/:id/resume

Invoices

GET /invoices
GET /invoices?customerId=cus_xxx

Sync

# Sync products from Stripe
POST /sync/products

# Sync prices from Stripe
POST /sync/prices

Webhooks

POST /webhook  # Stripe webhook endpoint

Configure in Stripe Dashboard:

  • Endpoint: https://yoursite.com/api/plugins/stripe/webhook
  • Events to send:
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.paid
    • invoice.payment_failed
    • checkout.session.completed
    • product.created
    • product.updated
    • price.created
    • price.updated

MCP Tools

Available tools for AI agents:

| Tool | Description | |------|-------------| | stripe_create_checkout | Create checkout session | | stripe_create_portal | Create customer portal session | | stripe_get_subscription | Get subscription details | | stripe_cancel_subscription | Cancel subscription | | stripe_list_products | List products | | stripe_list_prices | List prices | | stripe_list_subscriptions | List subscriptions | | stripe_list_invoices | List invoices | | stripe_sync_products | Sync products to LokiCMS |

Usage Examples

Create a Subscription Checkout

const response = await fetch('/api/plugins/stripe/checkout', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    priceId: 'price_monthly_pro',
    customerEmail: '[email protected]',
    mode: 'subscription',
    trialDays: 14
  })
});

const { url } = await response.json();
window.location.href = url;

Check User Subscription

// Get subscriptions for a customer
const subs = await fetch('/api/plugins/stripe/subscriptions?customerId=cus_xxx');
const { subscriptions } = await subs.json();

const activeSub = subscriptions.find(s => s.status === 'active');

Allow Customer to Manage Subscription

const response = await fetch('/api/plugins/stripe/portal', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    customerId: 'cus_xxx',
    returnUrl: window.location.href
  })
});

const { url } = await response.json();
window.location.href = url;

License

MIT