{"id":13792342,"url":"https://github.com/yusinto/ld-scheduler","last_synced_at":"2025-03-23T12:32:18.451Z","repository":{"id":143885389,"uuid":"82446386","full_name":"yusinto/ld-scheduler","owner":"yusinto","description":"Schedule Launch Darkly flags on or off","archived":false,"fork":false,"pushed_at":"2018-02-02T04:20:15.000Z","size":245,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T20:16:39.082Z","etag":null,"topics":["darkly","deployment","feature","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","featuretoggle","flags","launch","launch-darkly","launchdarkly","ld-react","ld-redux","ld-scheduler","ldclient","schedule","scheduler","slack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/yusinto.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}},"created_at":"2017-02-19T08:47:39.000Z","updated_at":"2023-03-07T16:48:44.000Z","dependencies_parsed_at":"2023-05-30T04:00:32.402Z","dependency_job_id":null,"html_url":"https://github.com/yusinto/ld-scheduler","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusinto%2Fld-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusinto%2Fld-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusinto%2Fld-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusinto%2Fld-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusinto","download_url":"https://codeload.github.com/yusinto/ld-scheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104464,"owners_count":20561376,"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":["darkly","deployment","feature","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","featuretoggle","flags","launch","launch-darkly","launchdarkly","ld-react","ld-redux","ld-scheduler","ldclient","schedule","scheduler","slack"],"created_at":"2024-08-03T22:01:11.168Z","updated_at":"2025-03-23T12:32:17.985Z","avatar_url":"https://github.com/yusinto.png","language":"JavaScript","funding_links":[],"categories":["Apps"],"sub_categories":[],"readme":"# ld-scheduler\n\n[![npm version](https://img.shields.io/npm/v/ld-scheduler.svg?style=flat-square)](https://www.npmjs.com/package/ld-scheduler) [![npm downloads](https://img.shields.io/npm/dm/ld-scheduler.svg?style=flat-square)](https://www.npmjs.com/package/ld-scheduler) [![npm](https://img.shields.io/npm/dt/ld-scheduler.svg?style=flat-square)](https://www.npmjs.com/package/ld-scheduler) [![npm](https://img.shields.io/npm/l/ld-scheduler.svg?style=flat-square)](https://www.npmjs.com/package/ld-scheduler) \n\n\u003e **A library to schedule launch darkly feature flag deployment** :alarm_clock:\n\nSo you use [Launch Darkly](https://launchdarkly.com/faq.html) for feature flagging and a/b testing which is very cool. Why this package then you ask?\n\nOnce you have created your feature flags in launch darkly, and then developed and tested your feature, you are now ready to deploy your code to production.\nYou will then also need to turn on your feature flags in production. You can do this at deploy time, either manually through the dashboard or programmatically \nthrough the launch darkly rest apis. However, what if your feature needs to be deployed at a later time? You need to decouple the deployment \nof your app from the deployment of your features. Enter ld-scheduler.\n\nYou can now create flags in launch darkly and then set a date and time you want the kill switch to be turned on or off. This decouples your app deployment\nfrom feature deployment. No one should stay up past midnight just to turn on/off the kill switch.\n\n * Schedule feature flags on or off at an exact date and time (useful for zero dark thirty deployments)  \n * Decouple code deployment from feature deployment\n * Works with slack! Ld-scheduler posts a message to slack when it successfully updates (or fails to update) your flags!\n\n## Installation\n\nyarn add ld-scheduler\n\nor the old school way\n\nnpm i --save ld-scheduler\n\n## Quickstart\n\n1. Create a new node project and set it up with babel. You'll need babel-register, babel-polyfill and babel-preset-latest. \nSee [here](https://github.com/yusinto/ld-scheduler/tree/master/example) for example.\n\n2. In your main code file, import ld-scheduler and call the runEveryXSeconds function. \nIf you don't use slack (you should!) you don't have to specify the slack property. \nBy default, ld-scheduler polls launch darkly every 60 seconds:\n    ```javascript\n    import ldScheduler from 'ld-scheduler';\n    \n    ldScheduler.runEveryXSeconds({\n      environment: 'test',\n      apiKey: 'your-secret-api-key',\n      slack: 'your-slack-webhook-url'\n    });\n    ```\n\n3. Tag your feature flag. In launch darkly's dashboard, under the Settings tab of your feature flag, under Tags, add one or more \"scheduled\" tags, each prefixed with an environment name.\nFor example, if you have both a test and production environment, you will need 2 tags: 'test-scheduled' and 'production-scheduled'.\nStill in the Settings tab, under Description, add the following JSON object:\n\n    ```javascript\n    {\n       \"taskType\": \"killSwitch\",\n       \"value\": true,\n       \"targetDeploymentDateTime\": \"2017-02-27 22:00 +11:00\",\n       \"description\": \"Test flag for dev\"\n    }\n    ``` \n    **where**\n    \n     * taskType is killSwitch\n     * value is true (kill switch on) or false (kill switch off)\n     * targetDeploymentDateTime must be in the format of YYYY-MM-DD HH:mm Z\n       **Note**: the utc offset is important otherwise moment will use the host's timezone. \n     * description is a textual string for the purpose of human readability\n\n    The screenshot below is an example configuration:\n  \n    ![ld-scheduler-flag-settings](https://cloud.githubusercontent.com/assets/1593077/23781221/ddd4557e-059f-11e7-8e4f-601e6cf91f78.png)\n\n4. Run your project and watch magic happens!\n\n## Example\nCheck [example](https://github.com/yusinto/ld-scheduler/tree/master/example) for a fully working example. \nRemember you'll need to enter your own launch darkly api key and your own slack url (if you use slack).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusinto%2Fld-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusinto%2Fld-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusinto%2Fld-scheduler/lists"}