> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opal.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LaunchDarkly

> Learn how to connect Opal to LaunchDarkly to manage account roles, team membership, and the custom roles that teams hold.

With the LaunchDarkly integration, you can manage access to your LaunchDarkly account from Opal:

* Allow users to request just-in-time access to an account role, such as **Writer**, from the web and Slack
* Allow users to request membership of a LaunchDarkly team
* Give a team a custom role, so every member of the team holds it
* Review account roles, team membership, and custom roles in access reviews
* Automatically revoke access when a time-bound grant expires

Opal connects to one LaunchDarkly account through a service token. To manage several accounts, add a LaunchDarkly app in Opal for each one.

## Supported resources

| Resource | Read | Grant and revoke access |
| - | - | - |
| LaunchDarkly Organization (account roles) | ✔️ | ✔️ (Revoke: not **Reader**) |
| LaunchDarkly Teams (membership and custom roles) | ✔️ | ✔️ |
| LaunchDarkly Roles (custom roles) | ✔️ | |

Opal syncs the members of your account, matched to people in Opal by email. The integration doesn't invite or remove members, which arrive through SSO or your identity provider, and it doesn't sync pending invitations until they're accepted.

### How LaunchDarkly access maps to Opal

* **Account roles**: your account appears in Opal as **LaunchDarkly Organization**, with the access levels **Reader**, **Writer**, **Admin**, and **Owner**. Each member holds one account role, so requesting a different role replaces the existing one.
  * **Owner** is synced, but it isn't offered in access requests, and Opal can't grant or revoke it. LaunchDarkly only lets the current Owner transfer ownership.
  * Revoking a role returns the user to **Reader**. Opal can't revoke **Reader**, because LaunchDarkly has no lower role short of removing the user from the account. Remove users through your identity provider instead.
  * Granting a role to the account Owner has no effect, so the Owner keeps **Owner**.
  * Members whose base role is **No access** are synced as users, but they don't hold an account role in Opal until you grant one.
* **Teams**: each team appears in Opal as a **LaunchDarkly Team**. Users can request membership of a team, and you can give a team custom roles. A team's custom roles apply to every member of the team.
* **Custom roles**: each custom role appears in Opal as a **LaunchDarkly Role**, with the members who hold it. Custom roles are read-only. To give people a custom role, give it to a team and add the people to that team.

### Limitations

* Custom roles that are assigned directly to a member sync into Opal for review, but Opal can't grant or revoke them. Give the custom role to a team instead.
* Opal doesn't sync team maintainers, or LaunchDarkly projects, environments, and flags.
* Opal doesn't invite members to LaunchDarkly or remove them.

## Requirements

Before you begin, you must:

* Be an Opal Admin
* Be able to create access tokens in LaunchDarkly
* Ask the Opal team to enable the LaunchDarkly integration for your organization

## Configuration steps

### 1. Create a service token

In LaunchDarkly, go to **Organization settings** > **Authorization** > **Access tokens**, and create a service token. Give the token one of the following:

* A custom role with **No access** base permissions, whose policy allows `updateRole` on `member/*`, and `viewTeam`, `updateTeamMembers`, and `updateTeamCustomRoles` on `team/*`.
* On plans without custom roles, the **Admin** role.

A token with the **Reader** role can sync access, but it can't change it.

Copy the token. You'll enter it in Opal in step 2.

### 2. Create the LaunchDarkly app in Opal

In Opal, go to **Inventory** > **+App** and select **LaunchDarkly**. Fill in the following fields:

| Field | Value |
| - | - |
| App name | A name for the LaunchDarkly app in Opal, for example `LaunchDarkly`. |
| App admin | The owner who administers the app in Opal. |
| Description | A short description that helps requesters understand what this app is. |
| Visibility | Who in your organization can see the app. |
| Instance | The host you sign in to LaunchDarkly at: `app.launchdarkly.com` (the default), `app.eu.launchdarkly.com` for EU accounts, or `app.launchdarkly.us` for Federal accounts. |
| Access token | The service token from step 1. |

Opal checks the token when you save the app.

### 3. Import the organization, teams, and roles

After you save the app, import the items you want to manage: on the app's **Assets** tab, select **Import assets**, choose **LaunchDarkly Organization**, the teams, and the custom roles, and turn on requests for them. Opal pulls access only for imported items, so roles and team members appear after the next sync.

## Troubleshooting

| Error | Fix |
| - | - |
| An authentication error when you save the app | Copy the token again, enter it without a `Bearer` prefix, and check that **Instance** matches the host you sign in to LaunchDarkly at. |
| Teams don't sync, or a sync finds no teams | LaunchDarkly hides teams from a token that can't view them. Add `viewTeam` on `team/*` to the token's role. |
| Custom roles don't sync | Custom roles aren't available on every LaunchDarkly plan. On those plans, the custom roles check on the app's **Setup** tab fails. |
| An access change fails | Check that the token's role has the permissions in step 1. A **Reader** token can't change access. |
| Granting or revoking **Owner** fails | LaunchDarkly only lets the Owner transfer ownership. |
| Revoking **Reader** fails | Opal doesn't remove members from LaunchDarkly. Deprovision the user through your identity provider. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.