cimplify

TypeScript SDK

Type-safe wrapper around the Cimplify REST API. Single dependency, browser-safe, framework-agnostic core, with a React layer and a Server Components layer on top.

Install

bun add @cimplify/sdk          # bun (recommended)
npm install @cimplify/sdk
yarn add @cimplify/sdk

Construct a client

import { createCimplifyClient } from '@cimplify/sdk'

export const client = createCimplifyClient({
  publicKey: process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY!,
  // Optional:
  // baseUrl: 'https://api.cimplify.io',
  // fetch:   customFetch,            // injected fetch (testing harness uses this)
})

The same client construction works in browsers, Node, Bun, Deno, Workers, and React Server Components. For server-side keys (sk_…) prefer getServerClient.

Result type: never throws

Every method returns Result<T, CimplifyError>. Always check .ok:

const r = await client.catalogue.getProducts()
if (!r.ok) {
  console.error(r.error.code, r.error.message)
  return
}
console.log(r.value.items)

Service surface

ServiceSurfacePage
client.catalogueProducts, variants, categories, collections, bundles, composites, add-ons, deals, quotesCatalogue →
client.cartAdd / update / remove items, apply coupon, get cartCart →
client.checkoutProcess checkout, payment authorization, poll statusCheckout →
client.authOTP request/verify, profile, logoutAuth →
client.ordersList, get, cancel, attach customer, verify paymentOrders →
client.schedulingVariant-aware slots, availability, bookings, reschedule, cancelScheduling →
client.subscriptionsList, cancel, pause, resume, skip-nextSubscriptions →
client.activityEvent recording, recommendations, dismissable messagesActivity →
client.fxSpot rate, locked quoteFX →
client.placesAddress autocomplete and detailsPlaces →
client.uploadsInit / upload / confirm flowUploads →
client.supportChat-widget conversations, send / list messagesSupport →

Public exports

SubpathUse
@cimplify/sdkBrowser-safe typed client + domain types + Result
@cimplify/sdk/react90+ components + 30+ hooks
@cimplify/sdk/serverServer Components helpers, cache tags, revalidate*
@cimplify/sdk/utilsMoney helpers, formatting, slug helpers
@cimplify/sdk/advancedLower-level escape hatches
@cimplify/sdk/mockProgrammatic mock for tests
@cimplify/sdk/mock/mswMSW handlers wrapping the in-process mock
@cimplify/sdk/testingTest harness: zod schemas, createTestClient, fixtures, assertX helpers
@cimplify/sdk/testing/suitePre-baked vitest suites: createBrandSuite, createCartFlowSuite, createContractSuite
@cimplify/sdk/styles.cssPre-compiled Tailwind utilities for the React components

Cross-cutting concepts

On this page