launchdarkly / js-client-sdk

LaunchDarkly Client-side SDK for Browser JavaScript
Other
113 stars 66 forks source link

How do we retrieve the tags or custom properties using ldclient? #291

Closed Treesha closed 7 months ago

Treesha commented 1 year ago

Scenario In current sdk, we get only the flag key and value but how do we deal with the situation where we need the tags and custom properties associated with the flag?

kinyoklion commented 1 year ago

Hello @Treesha,

The tags and custom properties are not accessed by the SDKs (not part of the APIs the SDKs used to get data), and are not available using the SDKs (JS or any other).

You can access them with the getFeatureFlag REST API if you have the project key and flag key. In the response, the fields you want are tags (array of strings) and customProperties (object whose fields are the custom property types; inside there you can find the name and value of each custom property).

You can find more information here: https://apidocs.launchdarkly.com/tag/Feature-flags#operation/getFeatureFlag

Thank you, Ryan

github-actions[bot] commented 7 months ago

This issue is marked as stale because it has been open for 30 days without activity. Remove the stale label or comment, or this will be closed in 7 days.