Skip to content
Kitenzo Headless is currently 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.
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 }) 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
});

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.
MethodSignatureReturnsDescription
listBundleslistBundles()Promise<Bundle[]>All published bundles (lightweight, no product data).
getBundlegetBundle(id: number)Promise<BundleDetail>One bundle with sections, products and variants merged.
submitBundlesubmitBundle(bundle, selections, { countryCode? })Promise<SubmitBundleResult>Validate the selection and create a configured bundle; returns variant/product, discount, subscription and pricing.
getSettingsgetSettings()Promise<ShopSettings>Shop currency, money format and active features.

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