Skip to Content
SDKAPI reference

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

ResourceMethodsDescription
client.brandget()Archetypes, niche intent, brand tones
client.tokensget()Design tokens (light/dark palette, fonts)
client.logoget(), listCandidates(), select(...)Selected logo SVG and candidate picking
client.palettelistOptions(), select(...)Color scheme options
client.guidelinesget()Full guidelines markdown + LLM prompt
client.designMdget()DESIGN.md for repo drop-in
client.studioget(), patchHtmlFrame(...)Studio canvas read/write
client.exportgetManifest(), downloadZip()Export bundle
client.pulsegetStatus(), listPosts(...)Pulse / X link status and posts
client.cursorHandoffget(), ack(...)Browser → agent handoff events
client.creativeCreative asset helpers
client.figmaFigma-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 returned

Exported types

Common response types exported from @majico/sdk:

  • BrandProfile, DesignTokens, LogoResponse, GuidelinesResponse
  • DesignMdResponse, StudioCanvas, StudioResponse, ExportManifest
  • PaletteOption, PulseStatusResponse, PulsePostsResponse
  • MajicoClientConfig, MajicoAgentClientConfig, MajicoError, MajicoErrorCode

HTTP helpers

Low-level utilities (used internally, also exported):

  • majicoFetchJson, majicoFetchRaw, normalizeBaseUrl
  • projectMcpPath, validateClientConfig, parseMajicoError

Full REST docs

Endpoint-level request/response shapes live in the repo: docs/api-reference.md .


Next: MCP server · Cursor integration