Socket
Book a DemoInstallSign in
Socket

react-launch-darkly

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-launch-darkly - npm Package Compare versions

Comparing version

to
1.4.0

8

build/index.js

@@ -6,3 +6,3 @@ "use strict";

});
exports.getAllFeatureFlags = exports.FeatureFlag = exports.LaunchDarkly = undefined;
exports.identify = exports.getAllFeatureFlags = exports.FeatureFlag = exports.LaunchDarkly = undefined;

@@ -17,2 +17,8 @@ var _utils = require("./lib/utils");

});
Object.defineProperty(exports, "identify", {
enumerable: true,
get: function get() {
return _utils.identify;
}
});

@@ -19,0 +25,0 @@ var _LaunchDarkly2 = require("./components/LaunchDarkly");

@@ -10,2 +10,3 @@ "use strict";

exports.getAllFeatureFlags = getAllFeatureFlags;
exports.identify = identify;

@@ -107,2 +108,22 @@ var _ldclientJs = require("ldclient-js");

});
}
/*
https://docs.launchdarkly.com/docs/js-sdk-reference#section-changing-the-user-context
"The hash parameter is the hash for the new user, assuming that the user's key has changed.
It is only required in secure mode-- if secure mode is not enabled,
you can pass in `null` for the hash."
*/
function identify(key, user) {
var hash = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var ldClient = ldClientWrapper(key, user);
return new Promise(function (resolve) {
ldClient.onReady(function () {
resolve(ldClient.identify(user, hash));
});
});
}

2

package.json
{
"name": "react-launch-darkly",
"version": "1.3.1",
"version": "1.4.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "./build/index",

@@ -62,2 +62,3 @@ # React-Launch-Darkly

- [Overriding Feature Flags](https://github.com/TrueCar/react-launch-darkly#overriding-feature-flags)
- [Identifying new users](https://github.com/TrueCar/react-launch-darkly#Identify-a-new-user)

@@ -208,2 +209,16 @@ ---

---
### Identify a new user
If you need to change the configured user for the launch darkly client you can do that by calling `identify`.
```
import { identify } from "react-launch-darkly";
identify(launchDarklyClientKey, launchDarklyUser, optionalUserHash);
```
See Launch Darkly's [documentation](https://docs.launchdarkly.com/docs/js-sdk-reference#section-changing-the-user-context) for more information.
#### Examples

@@ -210,0 +225,0 @@ ```

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.