Visual Studio Code (VSCode)
Visual Studio Code (VSCode)
Visual Studio Code (VSCode)
This topic explains how to use the LaunchDarkly VSCode extension to interact with feature flags from within Visual Studio Code (VSCode).
With the extension, you have the ability to:
@LaunchDarkly commands in GitHub Copilot to interact with your flagsctrl+alt+g/⌘+alt+g)
To complete this procedure, you must have the following prerequisites:
To set up the VSCode extension, you must complete the following steps:
To give your API access token the required permissions, one option is to create a custom role and add that role to the API access token.
Creating your own roles is only available to customers on select plans. To learn more, read about our pricing. To upgrade your plan, contact Sales.
To configure the VSCode extension, you must have an access token that targets version 20210729 or later of the LaunchDarkly REST API.
The following role allows Reader access to all projects and Writer access to the minimal set of fields the extension is able to update.
To create a role for the API access token:
Click the gear icon in the left sidebar to view Organization settings. The General settings page appears.
Click Roles.
Click New role. The “New role” page appears.
Enter a human-readable Name for the role.
Enter a Key for the role.
(Optional) Enter a Description to explain what the role does.
In the “Edit policy” panel, click View JSON to open the advanced editor.
Enter this policy in the “Editor” field:
Click Create role.
To give your API access token the required permissions, another option is to add the Writer base role to your access token.
To configure the VSCode extension, you must have an access token that targets version 20210729 or later of the LaunchDarkly REST API.
To add the Writer base role to a personal access token:
Your personal token now has the Writer base role.
After you install the LaunchDarkly extension, VSCode prompts you to sign in to your LaunchDarkly account:
Commercial, but FedRAMP members should select Federal.After you complete step 2, continue configuring the extension. If the configuration menu does not appear, run the command: LaunchDarkly: Configure settings.
You can reconfigure the extension at any time by running the “LaunchDarkly: Configure settings” command from the command palette (ctrl+shift+p/⌘+shift+p).
If you use GitHub Copilot and install the LaunchDarkly VSCode extension, you can use a set of @LaunchDarkly commands in GitHub Copilot to interact with your flags.
To learn how to install and use LaunchDarkly’s GitHub Copilot commands, read LaunchDarkly extension for GitHub Copilot.