SDK (B2B2C)Overview

CADbuildr SDK

The CADbuildr SDK lets a partner embed a CADbuildr-authored, parametric CAD configurator on their own website or storefront. Their end users tune parameters, the kernel renders meshes in real time, and (eventually) the partner turns a configured DAG into a manufacturable order.

If you are reading this, you are likely a CADbuildr customer who needs to ship a parametric configurator to your storefront or website.

What the SDK actually is

Three published TypeScript packages plus a Python parameter decorator on the design side:

  • @cadbuildr/sdk-react — the developer-facing surface: <CadbuildrProvider>, <CadbuildrViewer>, <CadbuildrParameterForm>, useCadbuildrRender(), plus the parameter-input substitution runtime.
  • @cadbuildr/cad-kernel-r3f — the lower-level KernelApiClient, R3F mesh primitives, and the per-mesh-hash geometry LRU. The SDK uses this internally; partners only touch it if they want custom rendering.
  • @cadbuildr/cad-pyodide-runtime — Pyodide bootstrap + runCadPythonCode(). Only needed for the Pyodide fallback path; the default frozen-DAG path ships no Pyodide.
  • cadbuildr_project decorator on the Python side (in cadbuildr.foundation) — emits the JSON parameter schema that drives <CadbuildrParameterForm> and the frozen-DAG template.

The architecture in one diagram

Partner browser (storefront)            Partner backend            CADbuildr hub                       CADbuildr kernel-api
──────────────────────────────          ────────────────           ─────────────                       ─────────────────────
<CadbuildrProvider sessionToken>   ──── POST {projectId,           POST /api/v1/sdk/session-tokens
<CadbuildrViewer parameters>            origin, endUserId?} ─────► verify cbsdk_*,
useCadbuildrRender(params)         ◄─── cbv1 session token ─────── mint cbv1 (jti, exp ~30min)
   │                                    (30min default)

   │  POST /v1/kernels/replicad/render
   │  Authorization: Bearer cbv1.<...>.<sig>
   ├──────────────────────────────────────────────────────────────────────────►  verify_signed_token (Node port)
   │                                                                            origin == payload.origin
   │                                                                            jti budget (Redis)
   │                                                                            compileWorker:
   │  ◄── JSON mesh response ────────────────────────────────────────────────    L1 LRU → L2 Redis (canonical(dag) + kernel ver)


client-side geometry LRU by mesh hash

The default render path does not run Pyodide in the embed. The partner ships a precomputed template.dag.json + parameters.schema.json; the SDK substitutes parameter values into ParameterInput nodes and posts the finished DAG.

Why this exists

The SDK lets you embed a real-time, parametric CAD configurator without running a long-lived secret in your browser bundle, standing up your own render backend, or shipping a heavy in-browser CAD runtime. Authentication, per-tenant quotas, and a shared geometry cache are all handled by CADbuildr’s hosted services, so you can drop a configurator into a static storefront with a few lines of TSX.

Next steps

  • Setup & install — install the packages and configure your partner key.
  • Auth & session tokens — provisioning cbsdk_* partner keys, exchanging them for short-lived cbv1 session tokens.
  • Viewer & provider<CadbuildrProvider> + <CadbuildrViewer> API.
  • Parameter form — the Python @cadbuildr_project decorator + the auto-generated React form.
  • Frozen-DAG mode — how the no-Pyodide fast path works.
  • Caching — how the render cache and client-side mesh cache keep configurators fast, and how to maximize the hit rate.