API reference
Package: @majico/sdk (currently 1.0.1).
MajicoClient
import { MajicoClient } from "@majico/sdk";
const client = new MajicoClient({
apiKey: string; // required — project API key
projectId: string; // required — project UUID
baseUrl?: string; // default https://api.majico.xyz
timeoutMs?: number;
exportTimeoutMs?: number;
retry?: { max?: number; retryOn?: number[] };
});Resources
| Resource | Methods | Description |
|---|---|---|
client.brand | get() | Archetypes, niche intent, brand tones |
client.tokens | get() | Design tokens (light/dark palette, fonts) |
client.logo | get(), listCandidates(), select(...) | Selected logo SVG and candidate picking |
client.palette | listOptions(), select(...) | Color scheme options |
client.guidelines | get() | Full guidelines markdown + LLM prompt |
client.designMd | get() | DESIGN.md for repo drop-in |
client.studio | get(), patchHtmlFrame(...) | Studio canvas read/write |
client.export | getManifest(), downloadZip() | Export bundle |
client.pulse | getStatus(), listPosts(...) | Pulse / X link status and posts |
client.cursorHandoff | get(), ack(...) | Browser → agent handoff events |
client.creative | — | Creative asset helpers |
client.figma | — | Figma-related endpoints |
Example:
const manifest = await client.export.getManifest();
const zip = await client.export.downloadZip();
const canvas = await client.studio.get();
await client.studio.patchHtmlFrame({
elementId: "hero",
html: "<h1>Hello</h1>",
});MajicoAgentClient
For server-side agents that create projects (requires MAJICO_AGENT_API_SECRET on the Majico server):
import { MajicoAgentClient } from "@majico/sdk";
const agent = new MajicoAgentClient({
baseUrl: "https://api.majico.xyz",
agentSecret: process.env.MAJICO_AGENT_API_SECRET!,
});
const { project, client } = await agent.bootstrapProject("my portal");
// client is a ready MajicoClient when projectApiKey is returnedExported types
Common response types exported from @majico/sdk:
BrandProfile,DesignTokens,LogoResponse,GuidelinesResponseDesignMdResponse,StudioCanvas,StudioResponse,ExportManifestPaletteOption,PulseStatusResponse,PulsePostsResponseMajicoClientConfig,MajicoAgentClientConfig,MajicoError,MajicoErrorCode
HTTP helpers
Low-level utilities (used internally, also exported):
majicoFetchJson,majicoFetchRaw,normalizeBaseUrlprojectMcpPath,validateClientConfig,parseMajicoError
Full REST docs
Endpoint-level request/response shapes live in the repo: docs/api-reference.md .
Next: MCP server · Cursor integration