Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2d0c1d6
Update the requestor to fetch data using either GET requests or REPOR…
jkodumal Aug 8, 2017
ea171da
Flip the option so that REPORT is not used by default
jkodumal Aug 8, 2017
dd3350a
Add tests for useReport
jkodumal Aug 8, 2017
353ef5a
implement sendEvents parameter
eplusminus Oct 17, 2017
9e83078
[ch4830] Add warning to `useReport` documentation
arun251 Dec 5, 2017
90f5d58
Log error when no SDK is specified for intialization
atrakh Dec 5, 2017
d3eea32
fix error message formatting
atrakh Dec 5, 2017
5d04f80
Log error when failed to reach flags/goals due to incorrect env key
atrakh Dec 5, 2017
65e95ea
Add test for no env key
atrakh Dec 5, 2017
27a2b14
don't return on init w/o env key
atrakh Dec 5, 2017
07b6c9f
Add CircleCI build status badge
apucacao Dec 13, 2017
fabcf35
Merge pull request #16 from launchdarkly/ag/add-build-status-badge
apucacao Dec 13, 2017
7a2fde4
Add safe wrappers around localStorage
Dec 11, 2017
b24e3b0
Merge pull request #6 from launchdarkly/jkodumal/ch4830/update-js-sdk…
apucacao Dec 15, 2017
a5d5c37
Merge branch 'master' into at/ch8473/js-client-null-or-incorrect-clie…
apucacao Dec 15, 2017
da4ff67
Merge pull request #14 from launchdarkly/at/ch8473/js-client-null-or-…
apucacao Dec 15, 2017
cda0181
Merge pull request #56 from mickeyreiss-visor/master
apucacao Dec 15, 2017
4a5de91
Merge branch 'master' of https://github.com/launchdarkly/js-client
apucacao Dec 15, 2017
393ce27
prepare 1.2.0
apucacao Dec 15, 2017
305d51c
add community section
apucacao Dec 15, 2017
735988b
Merge pull request #17 from launchdarkly/ag/community-section
apucacao Dec 15, 2017
48cae4f
respect "do not track" header
eplusminus Dec 19, 2017
3370330
comments
eplusminus Dec 19, 2017
4f0dac2
Merge pull request #9 from eplusminus/eb/send-events-param
apucacao Dec 27, 2017
8609c05
Add Promise support for client initializatoin
atrakh Dec 28, 2017
9ac7a0d
Remove reference to auto-inferring country based on IP
atrakh Dec 29, 2017
d859576
Merge branch 'master' into eb/do-not-track
eplusminus Jan 1, 2018
c41aa29
check for do-not-track header at a higher level
eplusminus Jan 1, 2018
287379e
add promise support to identify
atrakh Jan 2, 2018
26154b4
Merge pull request #23 from launchdarkly/at/remove-reference-to-geo-i…
atrakh Jan 2, 2018
4025c7a
Merge pull request #21 from eplusminus/eb/do-not-track
apucacao Jan 3, 2018
3bf9f15
Remove waitUntilChange, add promise wrapper to identify
atrakh Jan 3, 2018
db6f7f8
Update TS definitions for promise support
atrakh Jan 4, 2018
eb3a5f7
Merge pull request #22 from launchdarkly/at/ch3359/add-a-promise-inte…
atrakh Jan 5, 2018
774fdeb
cache in localStorage based on entire user object (#19)
atrakh Jan 5, 2018
859ff3e
Don't flush events when sendEvents is disabled
atrakh Jan 8, 2018
517c42f
implement private user attributes
eplusminus Jan 8, 2018
8b7a5de
strip unknown top-level attrs and never make "anonymous" attr private
eplusminus Jan 8, 2018
73bbc5a
misc cleanup
eplusminus Jan 8, 2018
db27a08
fix faulty parentheses nesting
eplusminus Jan 8, 2018
7b3c766
Merge pull request #27 from eplusminus/eb/private-attrs
apucacao Jan 10, 2018
745b4a2
polyfill object.assign
apucacao Jan 19, 2018
0b9cbad
Move sendEvents check into start function
atrakh Jan 22, 2018
7a9fd7c
Merge pull request #28 from launchdarkly/ag/ch10741/fix-tests-object.…
apucacao Jan 22, 2018
a58ccae
Merge pull request #26 from launchdarkly/at/dont-flush-events-when-se…
apucacao Jan 22, 2018
927baad
Prepare 1.3.0
apucacao Jan 22, 2018
7d13ef6
fix promise interface
apucacao Jan 23, 2018
ac96b00
Merge pull request #29 from launchdarkly/ag/ch10894/fix-promise-inter…
apucacao Jan 23, 2018
3469391
prepare 1.3.1
apucacao Jan 23, 2018
e1846a4
Merge remote-tracking branch 'public/master' into HEAD
atrakh Jan 30, 2018
5d24c56
require -> import
atrakh Jan 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
# Change log

All notable changes to the LaunchDarkly client-side JavaScript SDK will be
documented in this file. This project adheres to
[Semantic Versioning](http://semver.org).
All notable changes to the LaunchDarkly client-side JavaScript SDK will be documented in this file. This
project adheres to [Semantic Versioning](http://semver.org).

## [1.3.1] - 2018-01-23

### Fixed

* Methods that expose a `Promise` interface now properly return the resolution or rejection value to the caller.

## [1.3.0] - 2018-01-22

### Added

* Support for [private user attributes](https://docs.launchdarkly.com/docs/private-user-attributes).
* New `sendEvents` option to control whether the SDK should send events back to LaunchDarkly or not. Defaults to `true`.
* It is now possible to wait for SDK readiness using `waitUntilReady` which returns a `Promise`. `identify` also returns a `Promise` (while still supporting the callback argument), which should make
it easier to integrate into code that relies heavily on `Promise`'s for asynchronous code.
### Changed
* The SDK now respects the user's [do-not-track setting](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack)

## [1.2.0] - 2017-12-15

### Added

* Added `useReport` initialization option to use `REPORT` instead of `GET` when communicating with LaunchDarkly.
### Fixed
* Authentication errors will now be logged — the root cause for these errors is usually an invalid
client-side ID.

## [1.1.13] - 2017-12-12

Expand Down
58 changes: 28 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# LaunchDarkly SDK for Client-Side JavaScript

[![Circle CI](https://circleci.com/gh/launchdarkly/js-client/tree/master.svg?style=svg)](https://circleci.com/gh/launchdarkly/js-client/tree/master)

## Introduction

This is the official LaunchDarkly client-side JavaScript SDK. This SDK does two
Expand Down Expand Up @@ -149,11 +151,11 @@ Alternatively, you can bootstrap feature flags from local storage.

```js
var client = LDClient.initialize(
'YOUR_CLIENT_SIDE_ID',
user,
(options = {
bootstrap: 'localStorage',
})
'YOUR_CLIENT_SIDE_ID',
user,
(options = {
bootstrap: 'localStorage',
})
);
```

Expand All @@ -179,11 +181,11 @@ initialization:
```js
var user = { key: 'user.example.com' };
var client = LDClient.initialize(
'YOUR_CLIENT_SIDE_ID',
user,
(options = {
hash: 'SERVER_GENERATED_HASH',
})
'YOUR_CLIENT_SIDE_ID',
user,
(options = {
hash: 'SERVER_GENERATED_HASH',
})
);
```

Expand Down Expand Up @@ -215,7 +217,7 @@ the `change` event:

```js
client.on('change', function(settings) {
console.log('flags changed:', settings);
console.log('flags changed:', settings);
});
```

Expand All @@ -225,7 +227,7 @@ also subscribe to specific flags:

```js
client.on('change:YOUR_FLAG_KEY', function(value, previous) {
console.log('YOUR_FLAG_KEY changed:', value, '(' + previous + ')');
console.log('YOUR_FLAG_KEY changed:', value, '(' + previous + ')');
});
```

Expand Down Expand Up @@ -263,7 +265,7 @@ the authenticated user. To do this, you can call the `identify` function:

```js
client.identify(newUser, hash, function() {
console.log("New user's flags available");
console.log("New user's flags available");
});
```

Expand All @@ -278,25 +280,21 @@ also run `npm run watch` to rebuild the module automatically on file change.

To run the tests, run `npm run test`.

## Community

Here are resources from our awesome community:

* [TrueCar/react-launch-darkly](https://github.com/TrueCar/react-launch-darkly/): A set of component helpers to add support for LaunchDarkly to your React.js app
* [yusinto/ld-redux](https://github.com/yusinto/ld-redux/): A library to integrate LaunchDarkly with React and Redux
* [tdeekens/flopflip](https://github.com/tdeekens/flopflip): A flexible feature-toggling library that integrates with 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 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")
Expand Down
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ <h1>Settings</h1>
'another-client-side-flag': false
},
hash: 'c31e052b7b474e6e5f0c182144907e6fb6e55f20f5e7bc41b0b61624b16b5316',
baseUrl: 'http://dockerhost',
eventsUrl: 'http://dockerhost',
streamUrl: 'http://dockerhost:5050'
baseUrl: 'http://localhost',
eventsUrl: 'http://localhost',
streamUrl: 'http://localhost:5050',
useReport: true
});

function render(key, defaultValue) {
Expand Down
Loading