@servicetitan/ld-type-generator
v0.2.0
Published
CLI for generating TypeScript types for LaunchDarkly feature flags
Downloads
191
Readme
CLI for generating TypeScript types for LaunchDarkly feature flags.
Usage
Usage
$ npx @servicetitan/ld-type-generator [options]
Options
--apiKey LaunchDarkly API key (required)
--projectKey LaunchDarkly project key (required)
--sdkAvailability, --sdk SDK availability, available values: client, mobile, anyClient, server (default: client)
--state State, available values: live, deprecated, archived (default: live)
--camelCase Convert flag keys to camelCase (default: true)
Examples
$ npx @servicetitan/ld-type-generator --apiKey=your-api-key --projectKey=your-project-key
$ npx @servicetitan/ld-type-generator --apiKey=your-api-key --projectKey=your-project-key --sdkAvailability=server
$ npx @servicetitan/ld-type-generator --apiKey=your-api-key --projectKey=your-project-key --sdk=server
$ npx @servicetitan/ld-type-generator --apiKey=your-api-key --projectKey=your-project-key --state=archived
$ npx @servicetitan/ld-type-generator --apiKey=your-api-key --projectKey=your-project-key --sdk=server --state=archived
$ npx @servicetitan/ld-type-generator --apiKey=your-api-key --projectKey=your-project-key --camelCase=false
Getting an API key
- Navigate to https://app.launchdarkly.com/settings/authorization.
- Click on the "Create token".
- In the popup fill required fields. Set "This is a service token" checkbox and click "Save token".
- The generated token will be passed as --apiKey of this CLI tool.
Getting the project key
- Navigate to https://app.launchdarkly.com/settings/projects.
- Click on the copy button under the names of your project.
- That's the project key value (--projectKey CLI argument).