LanceDarkly
- Get started
- Commands
- Features
- Contributing
- Plugins API
Problem
Switching between VS Code, LaunchDarkly web app and other toggle integrations is inconvenient during development. Also, the LaunchDarkly app does not provide a view of toggle states (on|off) for all environments.
Solution
A VS Code extension to bring LaunchDarkly toggle management closer to your development environment and show all environment toggle states. Toggle on|off from VS Code.
Get started
You will need a LaunchDarkly account.
From LaunchDarkly you will need to generate an Access Token. You can find it under: Account Settings -> Access Tokens -> Your access tokens
.
Set the role
to writer
to update toggle state (Turn toggles on/off).
Default Project key. It's all lowercase and highlighted in gray. You can find it under: Account Settings -> Projects -> Your projects
Update your setting in VS Code under LanceDarkly
. See image below:
Commands
ctrl+shift+p
-> LanceDarkly: List all toggles
Opens a new tab listing all toggles. Selecting a toggle shows you details about it.
Features
- List all toggles in a project with a total count
- Dashboard to count and group toggles by age
- Search for toggles by name, key and description
- Sort toggles by created date
- Quick overview of toggle details:
- Title, created date, description, key and kind
- Maintainer information
- Variations: value and name
- Environments: show on or off state
- Show what variant is set for the selected toggle state
- Show a count of rules and prerequisites each environment
- Update toggle state on/off per environment
- Open toggle in LaunchDarkly
- Copy key to clipboard
- Settings for defaultProject and accessToken
- Display data from third parties using the LanceDarkly Plugin API
Toggle ON/OFF
Confirm with optional message to toggle feature ON.
Dashboard
Dashboard summary of toggles in the project.
Filter/search toggles
Search toggles by name, key or description.
Plugins
Extend the toggle details view with third party data.
Create a folder in your home directory called lancedarkly
with a file called plugins.js
: %user%/lancedarkly/plugins.js
.
The plugin function is called when the LanceDarkly: List all toggles
command is called.
Plugin API:
Only change the title
and fields
properties. Fields must be a 2D array.
The detailFields
will pass through the toggle key.
Maximum of four fields and unlimited rows. First field has LanceDarkly label style applied.
Field widths: 20% 15% 15% 50%
// plugins.js
async function plugins() {
const asyncData = await thirdPartyData(); // resolve data before turning API.
return [
{
detailFields(key) {
return {
title: "Title",
fields: [
["Production", "key", "guid", "random"],
["Integration", "key", "guid", "random"]
]
};
}
}
];
}
exports.plugins = plugins;