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

@thinkingcat/subscription-api

v1.0.1

Published

Subscription billing API route handlers for ThinkingCat services (SSO proxy)

Downloads

217

Readme

@thinkingcat/subscription-api

SSO 빌링 API로 프록시하는 구독 라우트 핸들러 팩토리. 타시스템(체크온 등)에서 동일한 구독/결제 API를 쓰기 위해 설정만 주입해 사용합니다.

설치

npm install @thinkingcat/subscription-api

또는 로컬 패키지:

"@thinkingcat/subscription-api": "file:../CM_subscription-api"

사용 (Next.js App Router)

각 라우트 파일에서 설정을 넘겨 핸들러를 생성한 뒤 re-export 합니다.

필수 env: SUBSCRIPTION_SERVER_URL, SUBSCRIPTION_SERVICE_KEY, SUBSCRIPTION_SERVICE_ID

예: pay/route.ts

import { NextRequest } from 'next/server';
import { getToken } from 'next-auth/jwt';
import { createPayHandler } from '@thinkingcat/subscription-api';

const handler = createPayHandler({
  getToken: (req) => getToken({ req: req as NextRequest, secret: process.env.NEXTAUTH_SECRET! }),
  serverUrl: process.env.SUBSCRIPTION_SERVER_URL!,
  serviceKey: process.env.SUBSCRIPTION_SERVICE_KEY!,
  serviceId: process.env.SUBSCRIPTION_SERVICE_ID || 'checkon',
  cacheCookieName: '_subscription_cache',
});

export const POST = handler;

제공 핸들러

| 함수 | 경로 | 메서드 | |------|------|--------| | createPlansHandler | 플랜 목록 | GET | | createCardsHandler | 카드 목록/등록/삭제 | GET, POST, DELETE | | createPayHandler | 구독 결제 | POST | | createSubscriptionsHandler | 구독 조회/해지 | GET, DELETE | | createPaymentsHandler | 결제 이력/취소 | GET, POST |

getToken은 호스트 앱 인증에 맞게 구현하면 됩니다 (예: next-auth getToken). 토큰에 id 필수, pay 시 name/email/phone 등 선택.