{"id":17753160,"url":"https://github.com/configcat/node-sdk","last_synced_at":"2025-07-27T23:42:21.941Z","repository":{"id":31874882,"uuid":"129965090","full_name":"configcat/node-sdk","owner":"configcat","description":"ConfigCat SDK for Node.js. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.","archived":false,"fork":false,"pushed_at":"2025-06-12T08:10:33.000Z","size":1315,"stargazers_count":21,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-12T09:26:00.938Z","etag":null,"topics":["configcat","configuration","configuration-management","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","node-js","nodejs","remote-config","typescript"],"latest_commit_sha":null,"homepage":"https://configcat.com/docs/sdk-reference/node","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/configcat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-17T21:06:41.000Z","updated_at":"2025-06-12T08:10:36.000Z","dependencies_parsed_at":"2023-11-24T15:27:28.117Z","dependency_job_id":"2ac54bef-4779-420f-b4e6-3cf7923c6569","html_url":"https://github.com/configcat/node-sdk","commit_stats":{"total_commits":295,"total_committers":19,"mean_commits":"15.526315789473685","dds":0.6576271186440679,"last_synced_commit":"9dfc76448d42bb0eeebf8870292e41e83935affc"},"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"purl":"pkg:github/configcat/node-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fnode-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fnode-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fnode-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fnode-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/configcat","download_url":"https://codeload.github.com/configcat/node-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fnode-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265429222,"owners_count":23763714,"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":["configcat","configuration","configuration-management","feature-flag","feature-flags","feature-toggle","feature-toggles","featureflags","node-js","nodejs","remote-config","typescript"],"created_at":"2024-10-26T13:22:55.494Z","updated_at":"2025-07-27T23:42:21.896Z","avatar_url":"https://github.com/configcat.png","language":"TypeScript","readme":"# ConfigCat SDK for Node.js\r\nhttps://configcat.com\r\n\r\nConfigCat SDK for Node.js provides easy integration for your application to ConfigCat.\r\n\r\nConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using \u003ca href=\"https://app.configcat.com\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.\r\n\r\nConfigCat is a \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003ehosted feature flag service\u003c/a\u003e. Manage feature toggles across frontend, backend, mobile, desktop apps. \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003eAlternative to LaunchDarkly\u003c/a\u003e. Management app + feature flag SDKs.\r\n\r\n[![Node CI](https://github.com/configcat/node-sdk/actions/workflows/node-ci.yml/badge.svg?branch=master)](https://github.com/configcat/node-sdk/actions/workflows/node-ci.yml) [![codecov](https://codecov.io/gh/configcat/node-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/configcat/node-sdk) [![Known Vulnerabilities](https://snyk.io/test/github/configcat/node-sdk/badge.svg?targetFile=package.json)](https://snyk.io/test/github/configcat/node-sdk?targetFile=package.json) ![License](https://img.shields.io/github/license/configcat/node-sdk.svg) [![Node.JS](https://img.shields.io/node/v/configcat-node)](https://img.shields.io/node/v/configcat-node) \\\r\n[![NPM](https://nodei.co/npm/configcat-node.png)](https://nodei.co/npm/configcat-node/) \r\n\r\n## Getting Started\r\n\r\n### 1. Install and import package:\r\n\r\n*via NPM [package](https://npmjs.com/package/configcat-node):*\r\n```bash\r\nnpm i configcat-node\r\n```\r\n```js\r\nconst configcat = require(\"configcat-node\");\r\n```\r\n\r\n### 2. Go to the \u003ca href=\"https://app.configcat.com/sdkkey\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e to get your *SDK Key*:\r\n![SDK-KEY](https://raw.githubusercontent.com/ConfigCat/node-sdk/master/media/readme02-3.png  \"SDK-KEY\")\r\n\r\n### 3. Create a *ConfigCat* client instance:\r\n```js\r\nconst configCatClient = configcat.getClient(\"#YOUR-SDK-KEY#\");\r\n```\r\n\r\n\u003e You can acquire singleton client instances for your SDK keys using the `getClient(\"\u003csdkKey\u003e\")` factory function.\r\n(However, please keep in mind that subsequent calls to `getClient()` with the *same SDK Key* return a *shared* client instance, which was set up by the first call.)\r\n\r\n### 4. Get your setting value:\r\nThe async/await way:\r\n```js\r\nconst value = await configCatClient.getValueAsync('isMyAwesomeFeatureEnabled', false);\r\n\r\nif (value) {\r\n  do_the_new_thing();\r\n} else {\r\n  do_the_old_thing();\r\n}\r\n```\r\nor the Promise way:\r\n```js\r\nconfigCatClient.getValueAsync('isMyAwesomeFeatureEnabled', false)\r\n  .then((value) =\u003e {\r\n    if (value) {\r\n      do_the_new_thing();\r\n    } else {\r\n      do_the_old_thing();\r\n    }\r\n  });\r\n```\r\n\r\n## Getting user specific setting values with Targeting\r\nUsing this feature, you will be able to get different setting values for different users in your application by passing a `User Object` to `getValueAsync()`.\r\n\r\nRead more about [Targeting here](https://configcat.com/docs/advanced/targeting/).\r\n```js\r\nconst userObject = new configcat.User(\"#USER-IDENTIFIER#\");\r\nconst value = await configCatClient.getValueAsync('isMyAwesomeFeatureEnabled', false, userObject);\r\n\r\nif (value) {\r\n  do_the_new_thing();\r\n} else {\r\n  do_the_old_thing();\r\n}\r\n```\r\n\r\n## Sample/Demo app\r\n  * [Sample Console application](https://github.com/configcat/node-sdk/tree/master/samples/console)\r\n  * [Sample Console application with ECMAScript module system](https://github.com/configcat/node-sdk/tree/master/samples/console-esm)\r\n  * [Sample application using Express and Docker](https://github.com/configcat/node-sdk/tree/master/samples/expresswithdocker)\r\n  * [Sample on how to get real time updates on feature flag changes](https://github.com/configcat/node-sdk/tree/master/samples/realtimeupdate)\r\n\r\n## Polling Modes\r\nThe ConfigCat SDK supports 3 different polling mechanisms to acquire the setting values from ConfigCat. After latest setting values are downloaded, they are stored in the internal cache then all requests are served from there. Read more about Polling Modes and how to use them at [ConfigCat Docs](https://configcat.com/docs/sdk-reference/node/).\r\n\r\n## Need help?\r\nhttps://configcat.com/support\r\n\r\n## Contributing\r\nContributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).\r\n\r\n## About ConfigCat\r\n- [Official ConfigCat SDK's for other platforms](https://github.com/configcat)\r\n- [Documentation](https://configcat.com/docs)\r\n- [Blog](https://configcat.com/blog)\r\n\r\n# Troubleshooting\r\n### Make sure you have the proper Node.js version installed\r\nYou might run into errors caused by the wrong version of Node.js. To make sure you are using the recommended Node.js version follow these steps.\r\n\r\n1. Have nvm (Node Version Manager - https://github.com/nvm-sh/nvm ) installed:\r\n1. Run `nvm install`. This will install the compatible version of Node.js.\r\n1. Run `nvm use`. This will use the compatible version of Node.js.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fnode-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfigcat%2Fnode-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fnode-sdk/lists"}