forked from launchdarkly/node-server-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prepare 5.8.0 release (launchdarkly#149)
- Loading branch information
1 parent
566dea0
commit 4a0f51c
Showing
23 changed files
with
634 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,42 @@ | ||
Contributing to the LaunchDarkly SDK for Node.js | ||
================================================ | ||
# Contributing to the LaunchDarkly Server-Side SDK for Node.js | ||
|
||
We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. | ||
LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK. | ||
|
||
## Submitting bug reports and feature requests | ||
|
||
The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/node-server-sdk/issues) in the SDK repository. Bug reports and feature requests specific to this SDK should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days. | ||
|
||
## Submitting pull requests | ||
|
||
We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days. | ||
|
||
## Build instructions | ||
|
||
### Prerequisites | ||
|
||
The project uses `npm`, which is bundled in all supported versions of Node. | ||
|
||
### Building | ||
|
||
To build, from the project root directory: | ||
|
||
``` | ||
npm install | ||
npm run build | ||
``` | ||
|
||
### Testing | ||
|
||
To run all unit tests: | ||
|
||
``` | ||
npm test | ||
``` | ||
|
||
By default, the full unit test suite includes live tests of the Redis integration. Those tests expect you to have a Redis instance running locally. To skip them, set the environment variable `LD_SKIP_DATABASE_TESTS=1` before running the tests. | ||
|
||
To verify that the TypeScript declarations compile correctly (this involves compiling the file `test-types.ts`, so if you have changed any types or interfaces, you will want to update that code): | ||
|
||
``` | ||
npm run check-typescript | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,46 @@ | ||
LaunchDarkly SDK for Node.js | ||
=========================== | ||
# LaunchDarkly Server-Side SDK for Node.js | ||
|
||
[![Circle CI](https://circleci.com/gh/launchdarkly/node-client/tree/master.svg?style=svg)](https://circleci.com/gh/launchdarkly/node-client/tree/master) | ||
[![Circle CI](https://circleci.com/gh/launchdarkly/node-server-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/launchdarkly/node-server-sdk/tree/master) | ||
|
||
Supported Node versions | ||
----------------------- | ||
## LaunchDarkly overview | ||
|
||
This version of the LaunchDarkly SDK has been tested with Node versions 6.14 and up. | ||
|
||
Quick setup | ||
----------- | ||
|
||
0. Install the Node.js SDK with `npm` | ||
|
||
npm install ldclient-node --save | ||
|
||
1. Require the LaunchDarkly client: | ||
|
||
var LaunchDarkly = require('ldclient-node'); | ||
|
||
|
||
2. Create a new LDClient with your SDK key: | ||
|
||
var ld_client = LaunchDarkly.init("YOUR SDK KEY") | ||
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today! | ||
|
||
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly) | ||
|
||
HTTPS proxy | ||
------------ | ||
## Supported Node versions | ||
|
||
Node provides built-in support for the use of an HTTPS proxy. You can use NPM to configure Node to proxy all network requests through the URL provided. | ||
``` | ||
npm config set https-proxy https://web-proxy.domain.com:8080 | ||
``` | ||
|
||
|
||
If your proxy requires authentication then you can prefix the URN with your login information: | ||
``` | ||
npm config set https-proxy http://user:[email protected]:8080 | ||
``` | ||
|
||
|
||
Your first feature flag | ||
----------------------- | ||
|
||
1. Create a new feature flag on your [dashboard](https://app.launchdarkly.com) | ||
2. In your application code, use the feature's key to check whether the flag is on for each user: | ||
|
||
ld_client.once('ready', function() { | ||
ld_client.variation("your.flag.key", {"key" : "[email protected]"}, false, function(err, show_feature) { | ||
if (show_feature) { | ||
# application code to show the feature | ||
} else { | ||
# the code to run if the feature is off | ||
} | ||
}); | ||
}); | ||
This version of the LaunchDarkly SDK has been tested with Node versions 6.14 and up. | ||
|
||
Using flag data from a file | ||
--------------------------- | ||
## Getting started | ||
|
||
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See `FileDataSource` in the [TypeScript API documentation](https://github.com/launchdarkly/node-client/blob/master/index.d.ts) for more details. | ||
Refer to the [SDK reference guide](https://docs.launchdarkly.com/docs/node-sdk-reference) for instructions on getting started with using the SDK. | ||
|
||
Learn more | ||
----------- | ||
## Learn more | ||
|
||
Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](http://docs.launchdarkly.com/docs/node-sdk-reference). | ||
|
||
Testing | ||
------- | ||
The authoritative description of all properties and methods is in the [TypeScript documentation](https://launchdarkly.github.io/node-server-sdk/). | ||
|
||
## Testing | ||
|
||
We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly. | ||
|
||
Contributing | ||
------------ | ||
## Contributing | ||
|
||
We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. | ||
We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK. | ||
|
||
About LaunchDarkly | ||
----------- | ||
## About LaunchDarkly | ||
|
||
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: | ||
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. | ||
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). | ||
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. | ||
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. | ||
* LaunchDarkly provides feature flag SDKs for | ||
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK") | ||
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK") | ||
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK") | ||
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK") | ||
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK") | ||
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK") | ||
* [Electron](http://docs.launchdarkly.com/docs/electron-sdk-reference "LaunchDarkly Electron SDK") | ||
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK") | ||
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK") | ||
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK") | ||
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK") | ||
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list. | ||
* Explore LaunchDarkly | ||
* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information | ||
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs | ||
* [apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation | ||
* [blog.launchdarkly.com](http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates | ||
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information | ||
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides | ||
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation | ||
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates | ||
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.