The most common setup mistake is a key in the wrong place
A surprising share of integration security comes down to one thing: using the correct key in the correct place. Crossdeck has exactly two — a publishable key and a secret key — and the difference between them is the difference between "safe in a browser" and "treat like a database password." Mix them up and you've either broken your app or leaked a credential.
Publishable to identify, secret to authenticate
- Publishable key (
cd_pub_…) — designed to ship in client code. It appears in browser network tabs, inside compiled mobile binaries, anywhere clients run, and that's intentional and safe. It proves "this request is from Crossdeck app X" — it's an app identifier, not a credential. - Secret key (
cd_sk_…) — a credential. It authenticates your server to Crossdeck and unlocks the operations that must never reach a client: manual entitlement grants, audit-log reads, and bulk operations like the migration import. Treat it like a database password — server-side only, never in a repo, never in a bundle.
The prefix tells you everything
The prefix is the contract: cd_pub_ is public-by-design, cd_sk_ is secret-by-design. A few rules follow from that:
- Test mode and live mode have their own keys, so a test key physically can't touch live data — the partner to the environment isolation you just saw.
- Web keys carry origin allowlists, so a publishable key only works from your own domains — a copied one is useless elsewhere.
- Keys rotate and revoke without downtime. Issue a new one, move traffic over, retire the old — no flash cut, so a suspected leak is a calm rotation, not an outage.
The rule that prevents most incidents: never put a cd_sk_ key in client code. The SDK init() even enforces the inverse — it rejects anything that isn't a cd_pub_ key — so a secret key in your front end fails loudly instead of leaking quietly.
Right key, right place
Publishable keys ride along in your apps doing their one safe job; secret keys stay on your servers guarding the privileged operations. If a key is ever exposed, you rotate it without downtime. That's the whole discipline — and the end of the Reference.
App identifier in the browser, credential on the backend, test and live kept apart — and any key rotatable without an outage.