SDK Overview
The threeu-sdk package provides typed SDKs for every development surface.
Installation
The ThreeU SDK is distributed as a single npm package with multiple entry points.
Install
Shell
npm install threeu-sdkSDK Exports
The package provides these entry points:
SDK Entry Points
TypeScript
// Core client — server-side, full access
import { Threeu } from "threeu-sdk";
// Admin SDK — admin dashboard development
import { ThreeuAdmin } from "threeu-sdk/admin";
// POS SDK — point-of-sale development
import { ThreeuPOS } from "threeu-sdk/pos";
// Storefront SDK — client-side storefront
import { ThreeuStorefront } from "threeu-sdk/storefront";
// Theme SDK — theme development
import { createTheme } from "threeu-sdk/theme";
// Plugin SDK — plugin development
import { createPlugin } from "threeu-sdk/plugin";Brand-Scoped SDK Model
The core SDK uses a brand-scoped model. Initialize with your secret key, then scope operations to a brand:
Brand-Scoped Operations
TypeScript
import { Threeu } from "threeu-sdk";
const threeu = new Threeu(process.env.THREEU_SECRET_KEY!);
const brand = await threeu.brand("my-store");
await brand.products.create({
name: "Black Abaya",
price: 350,
currency: "QAR"
});
const orders = await brand.orders.list();Brand Resources
| Resource | Methods |
|---|---|
brand.products | create(), list(), get(), update(), delete() |
brand.orders | list(), get(), update() |
brand.customers | list(), get(), create(), update() |
brand.inventory | adjust(), get(), list() |
brand.collections | list(), get(), create(), update() |
brand.discounts | list(), create(), update(), delete() |
brand.payments | list(), get() |
brand.shipping | getRates(), createShipment() |
brand.locations | list(), get() |
brand.pos | session() |
brand.analytics | summary(), sales(), products() |
brand.marketing | campaigns.list(), campaigns.create() |
brand.theme | get(), update() |
Each resource method is a scoped SDK object with full type safety and error handling.