API keybrowser
mt_…) instead. Key types
| Name | Type | Description |
|---|---|---|
PUBLIC | pk_… | Browser SDK on real hostnames. Configure Allowed Origins. Scopes: live content read. |
DEVELOPMENT | dk_… | Staging / development browser SDK. Toggle on/off in Settings; do not use for production traffic. |
SECRET | sk_… | Legacy server key for Content API. Prefer mt_ API tokens for new automation. |
When to use PUBLIC (pk_)
Production (and staging) browser traffic. Put publicKey: 'pk_…' in macro.config.js together with your website ID. Restrict Allowed Origins to the hostnames that may load the SDK.
When to use DEVELOPMENT (dk_)
Staging or development environments. Toggle the Development Key on when you want a separate frontend credential you can disable without touching production. Do not ship dk_ keys to production visitors.
What about SECRET (sk_)?
Legacy secret keys still authenticate some Content API flows (for example prerender or CI). New websites no longer auto-create them. Prefer API tokens with least privilege for any new server automation.
Origins whitelist
The PUBLIC key only accepts browser requests from listed origins. Add exact origins such as https://www.example.com. When you change the site’s primary domain, the dashboard can offer to update the public key allowlist — you can always edit origins later under SDK.
Do
- List every production (and staging) origin that loads the SDK.
- Use the Development key for staging instead of opening production origins too wide.
- Regenerate keys after a leak; the previous key keeps a short grace period.
Don’t
- Don’t commit
sk_/mt_secrets into public front-end config. - Don’t use a DEVELOPMENT key for production traffic.
- Don’t leave the PUBLIC allowlist empty if you expect origin checks to protect the site.
Rotation lifecycle
Regenerate in Settings → SDK
Choose Regenerate on the PUBLIC or DEVELOPMENT key. A new raw key is shown once (when reveal is allowed). Copy it into your config immediately.
Grace period
The previous key remains valid for a short grace window (dashboard default: 48 hours) so you can roll out config without downtime.
Deploy the new key
Update
macro.config.js(or your env injection) everywhere the SDK boots. After the grace period, the old key stops working.
Wire the SDK
export const macroConfig = {
apiBaseUrl: 'https://api.macrocontent.dev',
websiteId: 'your-website-uuid',
publicKey: 'pk_...',
}Full install steps: Developer quickstart · Content API auth: Content API
/management/sdk-keysmt_List SDK keys for the website (Management API; requires sdk_keys:read).