@blade-and-brawn/commerce
Printful and Webflow API clients, plus the ProductSyncer that keeps Webflow
CMS products/SKUs in sync with Printful's catalog.
Exports
PrintfulClient—new PrintfulClient({ storeId, token, webhookSecret }); products, webhooks.WebflowClient—new WebflowClient({ siteId, collectionIds: { products, skus }, token, webhookSecret }); CMS products/SKUs, webhooks.ProductSyncer—new ProductSyncer(printful, webflow);syncApparel(options)pulls Printful products and upserts them into the Webflow collections, respecting the naming conventions below.- Shared
Printful/Webflowrequest/response types (util/types.ts) and misc helpers (util/misc.ts, e.g.formatSlug).
Printful product naming conventions
- "Color-grouped" products follow the format
Product Name [color].
Constraints:
- A color-grouped product should have no more than one Printful color variant.
- That single color-grouped product's variant should match
[color]. - Printful product names should be unique.
See apps/api/src/scripts/register-webhooks.ts for how webhooks are
registered against the API's domain, and apps/api/src/services/commerce.ts
for how ProductSyncer is invoked.