pocketsflow package
is a server-side Node.js and TypeScript client for the Pocketsflow API. It uses
the same API-key authentication and endpoint shapes documented in the
API reference.
Install from npm
Add the SDK to a Node.js or TypeScript project.
View the source
Browse the SDK source, types, examples, and release history.
Installation
Initialize the client
Create an API key in Developers → API keys and keep it on your server. Usepk_live_... for live data or pk_test_... for sandbox data.
Read data
Resources expose typedlist() and get() methods:
products, variants, orders, customers,
reviews, discounts, upsells, subscriptions, subscriptionOffers,
webhooks, users, checkout, and refunds.
Create products and webhooks
Create subscription offers
UsesubscriptionOffers for the recurring products you sell. Use
subscriptions for the buyers who hold those offers; they are different
resources.
frequency must be weekly, monthly, or yearly. The required fields are
name, price, and frequency; the SDK also supports the optional offer
fields defined in its TypeScript types.
subscriptionOffers.create is included in the SDK source’s current v1.2.0
release. If npm still installs an older version in your environment, upgrade
when that release is published or call POST /subscriptions directly until
then.Create checkout sessions
Pass either a one-time product id or a subscription-offer id asproductId:
Manage subscribers
Thesubscriptions namespace manages buyer subscriptions and supports listing,
retrieval, cancellation, and refunds. The subscriber-specific lifecycle methods
are also available through the API endpoints documented in the
subscriptions quickstart.