Where can I find my 'user_key' for launchDarkly client?

346 Views Asked by At

I'm setting up the client on my React Native project

let client = new LDClient();
let config = { "mobileKey": "YOUR_MOBILE_KEY" };
let user = { "key": "user_key" }; // where do I find this info?

await client.configure(config, user);

I'm currently getting as a return value to this {"_U": 0, "_V": 0, "_W": null, "_X": null} assuming that's because of the missing user_key.

Where can I find my user_key?

2

There are 2 best solutions below

0
On

I believe you got the user_key from launchDarkly or you can check it in their API documentation on how to get the user_key

As for the problem where you get {"_U": 0, "_V": 0, "_W": null, "_X": null}, this is what you get when you log Promise before it resolve.

0
On

user_key is a unique string that identifies the user loading the website. It's something that you need to provide. LaunchDarkly needs to be able to differentiate your users in order to do things like partial rollouts.