Skip to content
Kitenzo Headless is invite-only. To enable it on your store, email support@kitenzo.com.

Provider & client

Wrap your app once. It memoizes a KitenzoClient, auto-fetches shop settings, and makes both available to descendant hooks.

import { KitenzoProvider } from '@kitenzo/react';
function App() {
return (
<KitenzoProvider apiKey={import.meta.env.VITE_KITENZO_API_KEY}>
<Outlet />
</KitenzoProvider>
);
}
PropTypeDefaultDescription
apiKeystring(required)Headless API key (kit_live_… / kit_test_…).
apiVersionstring'v1'API version segment.
baseUrlstringhttps://live.bb.eight-cdn.com/api/headless/v1Override the API base URL (e.g. for staging or local dev). When set, apiVersion is ignored.
countryCodestringShopify Markets country (ISO 3166-1 alpha-2, e.g. "DE"). Set it once and every price the hooks fetch and display honours that market. Must match the buyerIdentity.countryCode you set on the Shopify cart.
childrenReactNodeYour app.

Returns the KitenzoClient from the nearest provider. Throws if used outside <KitenzoProvider>.

const client = useKitenzo();
const bundles = await client.listBundles();

Returns the shop’s ShopSettings ({ currency, moneyFormat, activeFeatures, weightUnit }) or null while loading.

const settings = useSettings();
// settings?.moneyFormat → "${{amount}}"

You don’t need React to use the client — instantiate it anywhere (server loaders, scripts, other frameworks):

import { KitenzoClient } from '@kitenzo/core';
const client = new KitenzoClient({
apiKey: 'kit_live_…',
// baseUrl: 'http://localhost:8123/api/headless/v1', // optional override
// countryCode: 'DE', // optional default market
});

Constructor options — KitenzoClientOptions

Section titled “Constructor options — KitenzoClientOptions”
OptionTypeDefaultDescription
apiKeystring(required)Must start with kit_live_ or kit_test_.
apiVersionstring'v1'Must match v\d+.
baseUrlstringhttps://live.bb.eight-cdn.com/api/headless/v1Full base URL override.
countryCodestringDefault Shopify Market for getBundle / getPrice / submitBundle; overridable per call.
MethodSignatureReturnsDescription
listBundleslistBundles()Promise<Bundle[]>All published bundles (lightweight, no product data).
getBundlegetBundle(id, { countryCode? }?)Promise<BundleDetail>One bundle with sections, products and variants merged. With a country: presentment prices + market availability per variant.
getPricegetPrice(bundle, selections, { countryCode? }?)Promise<PriceResponse>Server-authoritative pricing without creating a configuration. Base-currency amounts; a country makes the discount maths market-correct.
submitBundlesubmitBundle(bundle, selections, { countryCode? }?)Promise<SubmitBundleResult>Validate the selection and create a configured bundle. Computes and forwards a firing conditions-engine discount automatically (the server validates and signs it).
getSettingsgetSettings()Promise<ShopSettings>Shop currency, money format, weight unit and active features.

Errors are thrown as KitenzoError (with .status and .response). See TypeScript types for the return shapes.