Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

paddle

БесплатноБез исполняемых скриптовНе проверен

Paddle is a merchant-of-record payments platform that sells software on a company's behalf and handles checkout, subscriptions, sales tax, VAT and invoicing…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Paddle

Overview

Paddle is a merchant of record — it handles payments, tax compliance (VAT, sales tax), invoicing, and fraud protection. Unlike Stripe, you don't need to register for tax in every country. Paddle sells on your behalf and remits taxes globally.

This skill covers Paddle Billing, the current product (every account created after 2023-08-08). Paddle Classic is a separate legacy product with a different API (vendors.paddle.com/api, Paddle.js v1, Paddle.Setup()); do not mix the two. Much older material on the web describes Classic.

An integration has three parts: Paddle.js opens the checkout in the browser, a webhook endpoint keeps your database in sync, and the server-side API changes subscriptions.

Instructions

Step 1: Accounts, keys and catalog

Sandbox and live are separate accounts with separate data, credentials and dashboards. Build against sandbox first.

Sandbox Live
Dashboard sandbox-vendors.paddle.com vendors.paddle.com
API base URL https://sandbox-api.paddle.com https://api.paddle.com
API key (server only) pdl_sdbx_apikey_… pdl_live_apikey_…
Client-side token (browser) test_… live_…

Create both credentials in Paddle > Developer tools > Authentication. Give the API key only the permissions the app needs and an expiry date. Create products and prices in the dashboard or the API; a price ID looks like pri_01gsz8x8sawmvhz1pv30nge1ke.

npm install @paddle/paddle-node-sdk @paddle/paddle-js
# .env.local
PADDLE_API_KEY=                    # pdl_sdbx_apikey_… — never sent to the browser
PADDLE_WEBHOOK_SECRET=             # pdl_ntfset_… — one per notification destination
NEXT_PUBLIC_PADDLE_CLIENT_TOKEN=   # test_… — safe to publish

Step 2: Checkout Integration

// components/SubscribeButton.tsx — Paddle.js overlay checkout
'use client'
import { useEffect, useState } from 'react'
import { initializePaddle, type Paddle } from '@paddle/paddle-js'

export function SubscribeButton({ priceId, userId, email }: { priceId: string; userId: string; email: string }) {
  const [paddle, setPaddle] = useState<Paddle>()

  useEffect(() => {
    initializePaddle({
      environment: 'sandbox',                               // omit for live
      token: process.env.NEXT_PUBLIC_PADDLE_CLIENT_TOKEN!,  // test_… in sandbox, live_… in production
    }).then(setPaddle)
  }, [])

  const openCheckout = () =>
    paddle?.Checkout.open({
      items: [{ priceId, quantity: 1 }],
      customer: { email },
      customData: { userId },   // copied to the subscription and to every later transaction
      settings: { displayMode: 'overlay', successUrl: 'https://app.fieldnote.io/billing/success' },
    })

  return <button onClick={openCheckout} disabled={!paddle}>Subscribe</button>
}

Without a bundler, load the script from Paddle's CDN (never self-host it) and call the same methods on the global:

<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
<script>
  Paddle.Environment.set('sandbox')   // sandbox only; remove for live
  Paddle.Initialize({ token: 'test_7d279f61a3499fed520f7cd8c08' })
</script>

Paddle.Initialize() may be called once per page; use Paddle.Update() afterwards. Pass an eventCallback to it to react to checkout.completed or checkout.closed in the page.

Step 3: Webhook Handler

Create a notification destination in Paddle > Developer tools > Notifications, choose its events and copy its secret key.

// app/api/paddle/webhook/route.ts — Process Paddle events
import { Paddle, Environment, EventName } from '@paddle/paddle-node-sdk'

const paddle = new Paddle(process.env.PADDLE_API_KEY!, {
  environment: Environment.sandbox,   // omit for live
})

export async function POST(req: Request) {
  const rawBody = await req.text()    // the raw body, never a re-serialized JSON object
  const signature = req.headers.get('paddle-signature') ?? ''

  let event
  try {
    // unmarshal() is async: it verifies the signature, then returns a typed event
    event = await paddle.webhooks.unmarshal(rawBody, process.env.PADDLE_WEBHOOK_SECRET!, signature)
  } catch {
    return new Response('Invalid signature', { status: 400 })
  }

  switch (event.eventType) {
    case EventName.SubscriptionCreated:
    case EventName.SubscriptionUpdated:   // renewals, upgrades, pauses, past_due, scheduled cancels
    case EventName.SubscriptionCanceled: {
      const sub = event.data
      await db.subscription.upsert({
        where: { paddleSubscriptionId: sub.id },
        create: { paddleSubscriptionId: sub.id, paddleCustomerId: sub.customerId,
                  userId: (sub.customData as { userId?: string } | null)?.userId,
                  status: sub.status, priceId: sub.items[0]?.price?.id, updatedAt: event.occurredAt },
        update: { status: sub.status, priceId: sub.items[0]?.price?.id, updatedAt: event.occurredAt },
      })
Полный SKILL.md на GitHub

Установить paddle в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл paddle?

Paddle is a merchant-of-record payments platform that sells software on a company's behalf and handles checkout, subscriptions, sales tax, VAT and invoicing. Use when a user asks to add subscription billing without handling tax compliance, accept international payments, integrate Paddle Checkout or Paddle webhooks, build a SaaS billing system on Paddle Billing, or let customers manage and cancel subscriptions.

Как установить скилл paddle?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл paddle запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить paddle с