Embed Happierleads screens
Security: server vs browser
Which keys and calls stay on your server, what is safe in the browser, and what to never do.
A key in a web page can be read by anyone who opens it. So keys only ever live on your server, and the browser only ever gets a link that works once.
Your server only
- Master key (
master-priv-…): acts as the account owner. - Embed key (
hle_…): can only open embedded sessions. - Creating, changing and deleting websites, setting credits and trials.
- Asking for the one-time link, after your own sign-in check.
Safe in the browser
- The tracking pixel snippet: it only carries the website's public id.
- The one-time link: it works once, within 60 seconds.
- The messages the frame sends your page (
ready,session-ended…).
Never
- A key in front-end code, a mobile app or a public repository.
DELETE /admin/websites/{id}, or any write, from the browser: proxy it through your server after your own permission check.- A
websiteIdtaken from the request: always from the signed-in user's company in your database. - One login shared between clients: one website and one client view each.
scope: "account"for anyone but your own staff.
If a key leaks
- Embed key: revoke it under Embed in your app → Server keys. Its open sessions end on their next request. Create a new one first to avoid downtime (up to 5 can be active).
- Master key: rotate it, see Authentication.
Before you go live
-
grepyour front-end build output formaster-priv-andhle_: no hits. - Signed out, your endpoint answers
401without calling us. - Sending another company's
websiteIdstill opens only the user's own. - The link response has
Cache-Control: no-storeand is never logged.
Bring your existing clients across
A one-off script, run before launch, that gives every client you already have a website.
Build it with your AI coding assistant
A ready prompt for Claude, Cursor or any AI coding assistant that builds every step of this section, with a checklist so nothing is forgotten.