Environment and SDK keys

Overview

This topic explains how to view and copy environment keys and SDK credentials.

Environment keys

You can view and copy an environment key from the Environments list:

The Environments list with the overflow menu open.

The Environments list with the overflow menu open.

You may need the environment key when configuring certain integrations.

SDK credentials

You can view, copy, or reset certain SDK credentials for an environment from the Environments list. SDK credentials include the SDK key, mobile key, and client-side ID.

You need one of these credentials when you set up your SDK. Which credential you need depends on which SDK you use:

  • Use SDK keys for server-side and AI SDKs. SDK keys should be kept secret. If an SDK key is exposed, you can reset it.
  • Use mobile keys for some client-side SDKs. Mobile keys do not need to be kept secret. However, if you wish to reset a mobile key, you can.
  • Use client-side IDs for JavaScript-based client-side SDKs and for edge SDKs. The client-side ID does not need to be kept secret and cannot be reset.
Using ldcli dev-server with client-side SDKs

When you connect a client-side SDK to the ldcli dev-server for local testing, use your project key as the SDK credential and set all service endpoints to http://localhost:8765.

Do not use an SDK key, mobile key, or client-side ID with the dev-server. If you use a client-side ID, the SDK connects to LaunchDarkly instead of the dev-server, which can result in CORS errors.

To learn more about different SDK key types, read Understanding the different types of SDKs and Keys.

View SDK credentials

To view an environment’s key, its SDK key, its mobile key, and its client-side ID:

  1. Click the project dropdown. The project menu appears:

    The project menu.

    The project menu.
  2. Select Project settings.

  3. Select Environments. The Environments list appears.

  4. Click the overflow menu for the environment.

    The Environments list with the overflow menu open.

    The Environments list with the overflow menu open.
  5. Click Show SDK keys. An “SDK Keys for [environment name]” dialog appears.

  6. The SDK credentials are hidden by default. To reveal a credential, click the eye icon.

Copy SDK credentials

To copy an SDK key, mobile key, or client-side ID:

  1. Click the project dropdown. The project menu appears.
  2. Select Project settings.
  3. Select Environments. The Environments list appears.
  4. Click the overflow menu for the environment.
  5. Click SDK key, Mobile key, or Client-side key to copy the key.

Reset SDK credentials

You can reset the SDK key and mobile key if needed. To learn how, read Reset SDK credentials.