Keys / LaunchDarkly
LAUNCHDARKLY_SDK_KEY
The SDK key your server-side SDK connects to one LaunchDarkly environment with to evaluate feature flags. Keep it secret.
- Starts with
sdk-- Expires
- never, unless you set an expiration date
- API
- create, list, update and delete (beta), and reset, with an access token
Get it
Create one on app.launchdarkly.com. The steps aren't recorded yet.
Set it
LAUNCHDARKLY_SDK_KEY=sdk-...
No official server-side SDK reads it; your app passes it to the SDK's init, as LaunchDarkly's examples do with LAUNCHDARKLY_SDK_KEY. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- In Organization settings, SDK keys, choose the project and environment and click New SDK key. You can set an expiration date on the old key.
- Deploy it everywhere that reads
LAUNCHDARKLY_SDK_KEY. Both keys work until you delete the old one or it expires. A Relay Proxy set up with a config file or environment variables uses only the default key, so update its config and restart it. - Check that nothing still uses the old key, then delete it. SDKs still using it fail and serve fallback values.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.