CartistoDocs

SDKs & tools

The official tooling, and how to call the API without one.

What’s official today

Tool Package For
Theme CLI @cartisto/cli Editing, previewing, and publishing themes from your editor / CI. See The CLI.
Theme SDK types @cartisto/theme-sdk The contract the CLI’s validate and the server’s publish gate share — the source of truth for theme rules.
Storefront SDK window.cartisto (served) The in-page client for theme code. See Theme SDK.

There is no separate server-side REST SDK yet — the API is a plain, envelope-shaped REST surface, so a ten-line client is all you need.

A minimal typed client

type Envelope<T> = { success: boolean; message: string; data: T };

export function makeClient(baseUrl: string, key: string) {
  return async function call<T>(path: string, init: RequestInit = {}): Promise<T> {
    const res = await fetch(`${baseUrl}/api/v1${path}`, {
      ...init,
      headers: {
        Authorization: `Bearer ${key}`,
        "Content-Type": "application/json",
        ...init.headers,
      },
    });
    const body = (await res.json()) as Envelope<T>;
    if (!body.success) throw Object.assign(new Error(body.message), { status: res.status });
    return body.data;
  };
}

That single function gives you consistent auth, error handling, and typing across every endpoint.

CLI in CI

The CLI reads credentials from the environment, so theme deploys run headless:

export CARTISTO_STORE_URL="https://acme.cartisto.app"
export CARTISTO_API_KEY="sk_xxxxxxxxxxxx"
cartisto theme validate && cartisto theme push --publish
Note

Extensibility scope Cartisto’s extension surface is this REST API + webhooks + curated themes — not a public in-process plugin runtime. If you need behavior the API doesn’t expose, that’s product feedback for a first-party feature, not a gap to script around.