What to copy into the site
| Name | Type | Description |
|---|---|---|
websiteId | UUID | Identifies the website to the Content API / SDK. |
publicKey | pk_… or dk_… | Frontend key for macro.config.js. |
apiBaseUrl | URL | API host — https://api.macrocontent.dev |
MACRO_SECRET_KEY | sk_… (env) | Server-only for prerender — never in browser config. |
X-Macro-Token | mt_… (env) | Management automation — Dashboard API tokens. |
Open Settings → SDK
In the website sidebar open Settings, then the SDK tab. You will see the website id and key material for PUBLIC (
pk_) and optional DEVELOPMENT (dk_) keys.Choose Public vs Development
Use
pk_for production origins you list on the key. Preferdk_for staging or development so you can disable that access without rotating production. Details on SDK keys.Set apiBaseUrl
Use
https://api.macrocontent.devinmacro.config.jstogether withwebsiteIdandpublicKey.Keep secrets on the server
Never put
sk_(legacy secret) ormt_(management token) inmacro.config.jsor any Vite client bundle. Prerender/CI uses envMACRO_SECRET_KEY; automation uses API tokens.
Origins
PUBLIC keys enforce allowedOrigins. Align them with domains you mark primary/active in Domains. See SDK keys for origin rules and Development keys.
Do
- Commit only
pk_/dk_in frontend config (still rotate if leaked). - Store
mt_/sk_in CI secrets.
Don’t
- Don’t paste management tokens into the browser SDK.
- Don’t reuse one production
pk_on untrusted third-party origins.
Next
Put values into macro.config.js and continue the Quickstart.