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

@asteby/metacore-billing

v24.0.0

Published

Metacore billing — subscription state, Stripe checkout/portal hooks, and the BillingSettings UI shared across host apps.

Readme

@asteby/metacore-billing

Shared billing surface for Metacore host apps (ops, link, …). Wraps the Go-side billing service (github.com/asteby/metacore-sdk/billing) with typed React hooks and the BillingSettings component used on the settings/billing route.

Why

Before extraction, ops and link each maintained a near-identical copy of the billing UI, lib client, and TypeScript types — three sources of truth for one feature. This package is the canonical version. Host-specific branding (plan icons, gradients, pricing copy) is fed in via props so the SDK stays brand-neutral.

Install

pnpm add @asteby/metacore-billing

Quickstart

import {
  createBillingClient,
  BillingSettings,
  type PlanDisplay,
} from '@asteby/metacore-billing'
import { Rocket, Zap, Building2 } from 'lucide-react'

const client = createBillingClient({
  fetcher: {
    get: (path) => api.get(path).then((r) => r.data),
    post: (path, body) => api.post(path, body).then((r) => r.data),
  },
})

const plans: PlanDisplay[] = [
  { slug: 'starter', name: 'Starter', icon: Zap, /* ... */ },
  { slug: 'pro', name: 'Pro', icon: Rocket, popular: true, /* ... */ },
  { slug: 'enterprise', name: 'Enterprise', icon: Building2, /* ... */ },
]

export function Billing() {
  return <BillingSettings client={client} plans={plans} />
}

Self-hosted

The Go service stores Stripe keys in the DB-backed platform_configs table. Admins rotate keys from the platform settings UI without redeploying; the client surfaces a clear error when the backend reports 503 billing_not_configured.

Backend

import (
    "github.com/asteby/metacore-sdk/billing"
    bhandlers "github.com/asteby/metacore-sdk/billing/handlers"
    "github.com/asteby/metacore-sdk/billing/models"
)

svc := billing.New(db,
    billing.WithPlatformDefaults(models.PlatformConfigDefaults{
        PlatformName: "Your App",
        SupportEmail: "[email protected]",
    }),
)
h := bhandlers.New(db, svc, bhandlers.Config{AppBaseURL: "https://app.example.com"})

api.Get("/billing/subscription",   authMW, h.Subscription)
api.Post("/billing/checkout-session", authMW, h.Checkout)
api.Post("/billing/portal-session",   authMW, h.Portal)
app.Post("/webhooks/stripe", h.Webhook)

See the Go package docs for the full contract.