Concepts
Keys
Publishable keys for app builds, secret keys for servers.
Keys are per app and environment, so the body of a request never names either.
| Kind | Prefix | Put it | It can |
|---|---|---|---|
| Publishable | uc_pub_<env>_ | inside app builds | send events, identify, purchases |
| Secret | uc_sec_<env>_ | your servers only | the above, plus set properties on any player and run imports |
Never ship a secret key
A secret key can write to any player's profile. If one ends up in a build or a public repo, rotate it right away.
Rotation
In Settings ▸ Apps, open the app and press Rotate under Environments & keys to issue a new key. The old one keeps working for 7 days so builds in players' hands keep sending while you ship an update. Revoke immediately when a key leaked.