A lightweight, zero-dependency SDK for the Gumroad API v2.
Full type safety. Works with Bun, Node.js, and browsers.
$ npm install gumroad-ts
Full type definitions for every endpoint, request, and response. Catch errors before they happen.
Built entirely on native fetch and crypto.subtle APIs. No bloat, no supply chain risk.
Primary target is Bun with full Node.js 16+ and browser compatibility baked in.
Products, Sales, Subscribers, Licenses, Offer Codes, Variants, Custom Fields, Webhooks, and Payouts.
Built-in HMAC-SHA256 signature verification to secure your incoming webhook payloads.
Ships both ESM and CommonJS builds so it works seamlessly in any project setup.
// 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, );
List, create, update, delete, toggle, enable, and disable products.
List, get, mark shipped, refund, and resend receipts for sales.
List and retrieve subscriber details for subscription products.
Verify, enable, disable, decrement usage, and rotate license keys.
Create and manage discount offer codes for your products.
Manage product variants and variant categories with full CRUD.
Add, update, and remove custom checkout fields on products.
Set up and manage webhook subscriptions for real-time events.
List and retrieve payout history and details.
gumroad-ts is free and open source, released under the MIT license. If it saves you time or helps power your project, consider sponsoring to keep development going.