Free & Open Source

The TypeScript SDK
for the Gumroad API

A lightweight, zero-dependency SDK for the Gumroad API v2.
Full type safety. Works with Bun, Node.js, and browsers.

$ npm install gumroad-ts
Bun 1.0+
Node.js 16+
Browsers
Zero Dependencies

Everything you need to build with Gumroad

🔷

TypeScript-first

Full type definitions for every endpoint, request, and response. Catch errors before they happen.

🪶

Zero Dependencies

Built entirely on native fetch and crypto.subtle APIs. No bloat, no supply chain risk.

Bun-first Runtime

Primary target is Bun with full Node.js 16+ and browser compatibility baked in.

📦

Complete API Coverage

Products, Sales, Subscribers, Licenses, Offer Codes, Variants, Custom Fields, Webhooks, and Payouts.

🔒

Webhook Verification

Built-in HMAC-SHA256 signature verification to secure your incoming webhook payloads.

📋

Dual Module Support

Ships both ESM and CommonJS builds so it works seamlessly in any project setup.

Up and running in minutes

// Install the package
// npm install gumroad-ts

import { GumroadClient } from "gumroad-ts";

const gumroad = new GumroadClient({
  token: "your-access-token",
});

// Get authenticated user
const { user } = await gumroad.user.get();
console.log(user.name);
// List all products
const { products } = await gumroad.products.list();

// Create a product
const { product } = await gumroad.products.create({
  name: "My Product",
  price: 1000, // in cents
});

// Get a single product
const { product } = await gumroad.products.get("product-id");

// Delete a product
await gumroad.products.delete("product-id");
// List sales with optional filters
const { sales } = await gumroad.sales.list({
  after: "2024-01-01",
  before: "2024-12-31",
});

// Refund a sale
await gumroad.sales.refund("sale-id");

// List subscribers
const { subscribers } = await gumroad.subscribers.list("product-id");
// Create a webhook subscription
await gumroad.resourceSubscriptions.create({
  resource_name: "sale",
  post_url: "https://your-server.com/webhooks",
});

// Verify webhook signature
const isValid = await gumroad.verifyWebhookSignature(
  rawPayload,
  signature,
  webhookSecret,
);

Complete Gumroad API v2 support

Products

List, create, update, delete, toggle, enable, and disable products.

Sales

List, get, mark shipped, refund, and resend receipts for sales.

Subscribers

List and retrieve subscriber details for subscription products.

Licenses

Verify, enable, disable, decrement usage, and rotate license keys.

Offer Codes

Create and manage discount offer codes for your products.

Variant Categories

Manage product variants and variant categories with full CRUD.

Custom Fields

Add, update, and remove custom checkout fields on products.

Resource Subscriptions

Set up and manage webhook subscriptions for real-time events.

Payouts

List and retrieve payout history and details.