Treatink Customizer SDK
@treatink/sdk is a TypeScript/JavaScript library that storefronts embed to add Treatink
product personalization: a native modal designer (photo upload, cutout selection, positioning,
pet-name text) plus a typed, publishable-key API client for catalog, artwork, drafts, and orders.
note
The SDK is distributed via GitHub Releases — see Quickstart § Install.
It runs end-to-end in fixtures mode (a bundled demo catalog, no backend and no API keys) by
default, so you can integrate and try the flow before provisioning; live catalog and order
submission are available behind mode: 'live'.
How it fits together
- In the browser the SDK uses a publishable key (
pk_test_…/pk_live_…) only. It fetches the catalog, opens the modal designer, uploads the shopper's artwork at save time, and assembles the order body — nothing secret ever runs client-side. - On your server one function,
submitOrderfrom@treatink/sdk/server, submits the finished order with your secret key. - Fixtures first. With
mode: 'fixtures'(the default) the whole flow — catalog, designer, upload, drafts, order building — runs locally against bundled fixture data, so you can integrate and demo before touching the live API.
At a glance
import { Treatink } from '@treatink/sdk';
const tk = Treatink.init({
apiKey: 'pk_test_quickstart', // publishable key only — sk_… keys throw
channel: 'petshop.example.com',
mode: 'fixtures',
});
tk.designer.open({
sku: 'SSGTTBC',
onComplete(result) {
// shopper saved — keep result.draftId for the cart line, result.previewUrl for the thumbnail
},
});
Where to go next
- Quickstart — install, the copy-runnable client flow, and order submission.
- Theming — match the designer to your storefront.
- Security & privacy — key discipline, photo handling, CSP.
- API reference — the full typed surface, wire contract, and errors.