Docs*). Prefer props for code strings so indentation stays clean. Callouts
Badges
betadeprecatednewJWTmt_API keyPublic
Install command
pnpm add @macrocontent/sdk @macrocontent/overlayCode block
Pass :code as a string so highlighting and copy always use the source — not the rendered HTML. Optional: show-line-numbers, highlight-lines ("2-3" or [2, 3]).
export const macroConfig = {
apiBaseUrl: 'https://api.macrocontent.dev',
websiteId: 'your-website-uuid',
publicKey: 'pk_...',
}Keyboard
⌘ K search · Esc close nav.
Code tabs
import { defineConfig } from 'vite'
import { macro } from '@macrocontent/sdk/vite'
export default defineConfig({
plugins: [macro({ config: '/macro.config.js' })],
})Steps
Install packages
Add the SDK and overlay to your site project.
pnpm add @macrocontent/sdk @macrocontent/overlayAdd config
Create
macro.config.jswith your website credentials.Wire the Vite plugin
Macrocontent injects on every HTML page automatically.
API endpoint
/management/whoamimt_Returns token identity and platformWebsiteId.
/management/content/nodesmt_Create a content node.
API example (request / response)
Who am I?
Confirm the management token and which website it belongs to.
curl https://api.macrocontent.dev/management/whoami \
-H "Authorization: Bearer mt_…"{
"ok": true,
"tokenType": "management",
"platformWebsiteId": "…"
}Parameter table
| Name | Type | Required | Description |
|---|---|---|---|
X-Macro-Token | string | required | Management token mt_… |
locale | string | optional | Content locale code |
cursor | string | optional | Pagination cursor |
File tree
Generic tabs
Editors work in the live overlay on the site.
Cards
Do / Don’t
Do
- Use primitives for single native elements.
- Build components for multi-field blocks.
Don’t
- Don’t rebuild H1/image as custom components.
- Don’t put secrets in
macro.config.jscommitted to public repos.
Accordion
What is a primitive?
A native HTML element marked with data-macro-key that Macrocontent edits inline.
What is a component?
A block with a JSON payload, field schema, and custom render().