{"id":26514866,"url":"https://github.com/devcyclehq/feature-importer","last_synced_at":"2025-03-21T05:29:39.562Z","repository":{"id":104786823,"uuid":"597144121","full_name":"DevCycleHQ/feature-importer","owner":"DevCycleHQ","description":"DevCycle - 3rd Party Feature Importer","archived":false,"fork":false,"pushed_at":"2024-12-17T21:18:59.000Z","size":501,"stargazers_count":13,"open_issues_count":6,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-17T22:24:49.789Z","etag":null,"topics":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"latest_commit_sha":null,"homepage":"https://docs.devcycle.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevCycleHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-03T18:16:33.000Z","updated_at":"2024-12-17T21:19:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"71f65d53-e15c-4622-9a57-e401394c26ce","html_url":"https://github.com/DevCycleHQ/feature-importer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Ffeature-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Ffeature-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Ffeature-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Ffeature-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevCycleHQ","download_url":"https://codeload.github.com/DevCycleHQ/feature-importer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745219,"owners_count":20503040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"created_at":"2025-03-21T05:29:39.033Z","updated_at":"2025-03-21T05:29:39.555Z","avatar_url":"https://github.com/DevCycleHQ.png","language":"TypeScript","readme":"# DevCycle Feature Importer\n\nDevCycle's Feature Importer is designed to import resources from other feature flag providers. \nThe importer is intended to be run on a single project and will create or update a project with the same key containing Environments, Features, and Variables. \n\n## Table of Contents\n- [Setup](#setup)\n- [Configuration](#configuration)\n  - [Required](#required)\n  - [Optional](#optional)\n- [Code Migration](#code-migration)\n\n## Setup\n1. Run `npm install` to install dependencies\n2. Setup [configuration file](#configuration)\n3. Run `npm start` to start import\n\n## Configuration\nThe feature importer can be configured using environment variables or a JSON config file. \nBy default the config is read from `config.json` in the project root, this can be overwritten using `CONFIG_FILE_PATH`.\n\n```\nNote: This feature importer only supports LaunchDarkly API Version `20220603`. Please select this version when creating an API access token in LaunchDarkly.\n```\n\n### Required\n\n- \u003cb\u003eldAccessToken\u003c/b\u003e: \u003ci\u003estring\u003c/i\u003e\n  - LaunchDarkly access token, used for pulling feature flags\n  - Equivalent env var: LD_ACCESS_TOKEN\n- \u003cb\u003edvcClientId\u003c/b\u003e: \u003ci\u003estring\u003c/i\u003e\n  - DevCycle client ID, used for fetching API credentials\n  - Equivalent env var: DVC_CLIENT_ID\n- \u003cb\u003edvcClientSecret\u003c/b\u003e: \u003ci\u003estring\u003c/i\u003e\n  - DevCycle client secret, used for fetching API credentials\n  - Equivalent env var: DVC_CLIENT_SECRET\n- \u003cb\u003esourceProjectKey\u003c/b\u003e: \u003ci\u003estring\u003c/i\u003e\n  - LaunchDarkly's project key, resources will be pulled from this project\n  - Equivalent env var: SOURCE_PROJECT_KEY\n\n### Optional\n- \u003cb\u003etargetProjectKey\u003c/b\u003e: \u003ci\u003estring\u003c/i\u003e\n  - A DevCycle project key, resources will be created within this project. A project will be created with this key if it does not already exist.\n  - If not specified, the target project key will be used\n  - Equivalent env var: TARGET_PROJECT_KEY\n- \u003cb\u003eincludeFeatures\u003c/b\u003e: \u003ci\u003estring[]\u003c/i\u003e\n  - An array of LD feature flag keys to be imported. By default, the importer will attempt to migrate all features.\n  - Equivalent env var: INCLUDE_FEATURES\n- \u003cb\u003eexcludeFeatures\u003c/b\u003e: \u003ci\u003estring[]\u003c/i\u003e\n  - An array of LD feature flag keys to be skipped when importing.\n  - Equivalent env var: EXCLUDE_FEATURES\n- \u003cb\u003eoverwriteDuplicates\u003c/b\u003e: \u003ci\u003eboolean\u003c/i\u003e\n  - If true, when the importer encounters a duplicate resource it will be overwritten. By default, duplicates will be skipped.\n  - Equivalent env var: OVERWRITE_DUPLICATES\n- \u003cb\u003eoperationMap\u003c/b\u003e: \u003ci\u003eMap\u003cstring, string\u003e\u003c/i\u003e\n  - A map of LD operations to map to DevCycle operations\n  - DevCycle operations: `=`, `!=`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=`, `contain`, `!contain`, `exist`, `!exist`, `startWith`, `!startWith`, `endWith`, `!endWith`\n  - Equivalent env var: OPERATION_MAP\n- \u003cb\u003eprovider\u003c/b\u003e: \u003ci\u003estring\u003c/i\u003e\n  - The provider to import the feature flags from.\n  - currently only `launchdarkly` is supported but this will extend with support\n\nSample config.json\n\n```json\n{\n  \"ldAccessToken\": \"api-key\",\n  \"dvcClientId\": \"clientId\",\n  \"dvcClientSecret\": \"clientSecret\",\n  \"sourceProjectKey\": \"project-key\",\n  \"includeFeatures\": [\"feat-1\", \"feat-2\"],\n  \"excludeFeatures\": [],\n  \"overwriteDuplicates\": false,\n  \"operationMap\": {\n\t\t\"startsWith\": \"contain\",\n\t\t\"endsWith\": \"contain\"\n\t},\n  \"provider\":\"launchdarkly\"\n}\n```\n\nSample .env file\n\n```bash\nLD_ACCESS_TOKEN=\"api-key\"\nDVC_CLIENT_ID=\"clientId\"\nDVC_CLIENT_SECRET=\"clientSecret\"\nSOURCE_PROJECT_KEY=\"project-key\"\nINCLUDE_FEATURES=[feat-1,feat-2]\nEXCLUDE_FEATURES=[]\nOVERWRITE_DUPLICATES=false\nOPERATION_MAP='{\"endsWith\":\"contain\",\"startsWith\":\"contain\"}'\nPROVIDER='launchdarkly'\n```\n\n## Code Migration\n### Migrating Code from LaunchDarkly\n- In LD the primary identifier is `key`, in DVC the equivalent value should be passed as `user_id`\n- DVC supports the following top-level properties on the user object: see [DVC User Object](https://docs.devcycle.com/docs/sdk/client-side-sdks/javascript#dvc-user-object).\n  Any other properties used for targeting should be passed within the `customData` map.\n- If you are passing a date to be used with LD's before/after operators, the value should to be converted to a long when passed to DVC. The importer will convert `before` \u0026 `after` operators to `\u003c` \u0026 `\u003e` in DVC.\n- DVC doesn't support targeting by the top-level `isAnonymous` property. If you are using LD's targeting with the `anonymous` attribute, make sure to include an `anonymous` property in the user's `customData`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Ffeature-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcyclehq%2Ffeature-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Ffeature-importer/lists"}