Usage
Components are auto-imported (
Docs*). Prefer props for code strings so indentation stays clean. Callouts
Info
Info — neutral product facts.
Tip
Tip — recommended approach.
Warning
Warning — easy to get wrong.
Danger
Danger — can break production data.
Success
Success — expected good outcome.
Badges
betadeprecatednewJWTmt_API keyPublic
Install command
pnpm add @macrocontent/sdk @macrocontent/overlayCode block
export const macroConfig = {
apiBaseUrl: 'https://api.macrocontent.dev',
websiteId: 'your-website-uuid',
publicKey: 'pk_...',
}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
Macro injects on every HTML page automatically.
API endpoint
GET
/management/whoamimt_Returns token identity and platformWebsiteId.
POST
/management/content/nodesmt_Create a content node.
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
macro.config.js
vite.config.ts
macro-nodes.ts
main.ts
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 Macro edits inline.
What is a component?
A block with a JSON payload, field schema, and custom render().