Session tokens for CDN search — keep API keys off the page
securityembed
The anti-pattern
Putting data-aac-key="aac_live_…" in HTML lets anyone scrape your index, burn quota, or write documents if the key is too wide.
The pattern
- On your backend,
POST /api/v1/embed/sessionwith a server-side API key. - Return the session token to the page.
- Load the CDN script with
data-aac-token(and optional mount id).
The token is search-scoped and expires. Console Embed settings (accent, facets, Related / For you) load from your origin on every page view — no redeploy.
Bonus
Pass a stable clientId when the shopper is logged in so personalization and recommendations follow them across devices.