@summoniq/bizfoo-client-sdk
v0.2.0
Published
TypeScript client for the bizfoo public storefront API.
Maintainers
Readme
@summoniq/bizfoo-client-sdk
TypeScript client for the bizfoo public storefront API.
Install
npm i @summoniq/bizfoo-client-sdkUsage
import { createBizfooClient } from "@summoniq/bizfoo-client-sdk";
const bizfoo = createBizfooClient({
storefront: "your-storefront-slug",
});
// Anonymous read — no key required
const { products } = await bizfoo.listProducts();
const { product } = await bizfoo.getProduct("nextjs-saas-starter");
// Checkout — requires a public key
const authed = createBizfooClient({
storefront: "your-storefront-slug",
publicKey: process.env.BIZFOO_PUBLIC_KEY,
});
const { url } = await authed.createCheckout({
items: [{ priceId: "price_abc" }],
email: "[email protected]",
successUrl: "https://your-store.com/success?order={ORDER_ID}",
cancelUrl: "https://your-store.com/cancel",
});What you get
- Typed
BizfooProduct,BizfooPrice,BizfooStorefront, etc. - Full storefront content types: features, integrations, assets, how-it-works steps, FAQs, highlight stats, code samples, and post-purchase setup steps.
BizfooErrorwith astatuscode for error handling.formatBizfooPrice(price)helper.
Defaults
baseUrldefaults tohttps://bizfoo.com.publicKeyis optional for anonymous reads; required for checkout.fetchdefaults toglobalThis.fetch(works on Node ≥ 18 and browsers).
License
MIT
