@vjog/studio-sdk
v0.1.0
Published
Lightweight JS/TS client for the Diatech Studio API — project creation, AI design generation (image/video/CAD), pricing, natural-language search, and chat.
Readme
@vjog/studio-sdk
A lightweight JS/TS client for the Diatech Studio API: project creation, AI design generation (image/video/CAD), pricing, natural-language search, and project-scoped chat. See the Studio integration guide for the full API reference this wraps.
Install
npm install @vjog/studio-sdkServer-side (Node, full access)
import { StudioClient } from "@vjog/studio-sdk";
const studio = new StudioClient({ apiKey: process.env.STUDIO_API_KEY });
const { uid } = await studio.generate({ prompt: "a delicate rose gold pendant with a pear diamond" });
const project = await studio.getProject(uid);Browser-side (your own frontend, project-scoped)
Mint a short-lived, project-scoped token from your backend (e.g. via
createEmbedSession, or your own signed JWT), then hand it to the browser.
Never ship your API key to a browser.
const studio = new StudioClient({ token: projectToken });
const asset = await studio.iterate(projectUid, { changes: "make the band thinner" });Browser mode requires the SDK's baseUrl to be a host registered for your
app (the same requirement the hosted iframe embed already has) so the session
token is a first-party cookie.
What's covered
- Projects: create, list, get, update, add references, style profile, CAD download
- Generation:
generate(new design),iterate(edit/regenerate/video/CAD/copy),price - Search:
search(natural-language description, or an image URL for visual similarity) chat(streamed, project-scoped assistant),getChatHistory- Roll-up jobs:
bulkGenerate,autoGenerate,getJob,listJobs transcribe(speech-to-text)- Hosted embed helpers:
createEmbedSession,updateEmbedSession
Build
npm install
npm run build