Documentation Index
Fetch the complete documentation index at: https://docs.waffo.ai/llms.txt
Use this file to discover all available pages before exploring further.
SDKs & Libraries
Waffo Pancake provides official SDKs for TypeScript and Next.js, plus direct API access.Choose Your Integration Level
Next.js SDK
Fastest — Drop-in components, hooks, and server actions. Handles checkout UI, webhook routing, and buyer self-service out of the box.
npm install @waffo/pancake-nextjsTypeScript SDK
Flexible — Full API coverage with automatic signing, typed responses, and webhook verification. Use with any Node.js framework.
npm install @waffo/pancake-tsDirect API
Full control — REST endpoints for writes, GraphQL for reads. Implement signing and verification yourself. Any language.
TypeScript SDK
@waffo/pancake-ts
Official TypeScript SDK on npm
Installation
Features
- Zero runtime dependencies, ESM + CJS, Node >= 20
- Automatic request signing with deterministic idempotency keys
- Full TypeScript type definitions (15 enums, 40+ interfaces)
- Webhook verification with embedded public keys (test/prod)
Quick Start
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
merchantId | string | Yes | Your Merchant ID |
privateKey | string | Yes | RSA private key (PEM, base64, or raw — auto-normalized) |
baseUrl | string | No | API base URL (default: production) |
fetch | typeof fetch | No | Custom fetch implementation |
Available Resources
| Namespace | Methods | Description |
|---|---|---|
client.stores | create() update() delete() | Store management |
client.onetimeProducts | create() update() publish() updateStatus() | One-time product CRUD |
client.subscriptionProducts | create() update() publish() updateStatus() | Subscription product CRUD |
client.subscriptionProductGroups | create() update() delete() publish() | Product groups for shared trial |
client.orders | cancelSubscription() | Order management |
client.checkout | createSession() | Create checkout sessions |
client.graphql | query<T>() | Typed GraphQL queries |
client.auth | issueSessionToken() | Issue buyer session token for checkout |
client.webhooks | verify() | Webhook signature verification |
Checkout Modes
The SDK supports two checkout modes based on whether you know the buyer’s identity:| Mode | Method | Buyer Identity | Form | Use Case |
|---|---|---|---|---|
| Authenticated | checkout.authenticated.create() | Merchant provides | Pre-filled | Sites with user accounts |
| Anonymous | checkout.anonymous.create() | Not provided | Empty | Template stores, shared links |
Authenticated Checkout (Recommended)
buyerIdentity is for order attribution and trial tracking only — it is not rendered on the checkout page. To pre-fill the email field on the checkout form, pass buyerEmail explicitly.Anonymous Checkout
Webhook Verification
Error Handling
Next.js SDK
@waffo/pancake-nextjs
Official Next.js SDK — components, hooks, and server actions
Installation
@waffo/pancake-ts as a peer dependency. Works with Next.js 14+ App Router.
Client Exports
| Export | Type | Description |
|---|---|---|
CheckoutButton | Component | Three-mode checkout button (link / anonymous / authenticated) |
WaffoPancakeProvider | Component | Buyer self-service context with automatic token lifecycle |
useCheckout() | Hook | Programmatic checkout control |
useBuyer() | Hook | Buyer self-service actions (cancel, refund, reactivate, query) |
useBuyerOrders() | Hook | Fetch buyer’s orders |
useBuyerPayments() | Hook | Fetch buyer’s payment records |
useBuyerRefundTickets() | Hook | Fetch buyer’s refund tickets |
useMerchantOrders() | Hook | Merchant dashboard orders |
useMerchantSales() | Hook | Merchant sales overview |
useMerchantSubscriptions() | Hook | Merchant subscription overview |
Webhook | Route Handler | Auto-verify signatures and dispatch events |
Server Exports (@waffo/pancake-nextjs/server)
| Export | Description |
|---|---|
createCheckoutAction(config) | Server Action: create checkout sessions |
createBuyerTokenAction(config) | Server Action: issue buyer session tokens |
createBuyerSessionAction(config) | Server Action: buyer self-service operations |
createMerchantQueryAction(config) | Server Action: merchant GraphQL queries |
Quick Example
Webhook Route Handler
Next.js Guide
Full step-by-step Next.js integration guide.
Direct API Access
You can also use the REST and GraphQL API directly. API Key authentication is handled automatically by the SDK — no manual header setup is needed.SDK Roadmap
| Language | Status |
|---|---|
| Node.js / TypeScript | Available — @waffo/pancake-ts |
| Next.js | Available — @waffo/pancake-nextjs |
| Python | Planned |
| Go | Planned |
| PHP | Planned |
Framework Guides
Next.js
Build with Next.js and Server Actions.
Checkout Sessions
Create checkout flows programmatically.
Subscriptions
Implement recurring billing.
Webhooks
Receive real-time event notifications.
API Reference
For complete endpoint documentation:API Reference
Full REST and GraphQL API documentation.