unleash-proxy-client-js icon indicating copy to clipboard operation
unleash-proxy-client-js copied to clipboard

Add support to provide namePrefix and tags for filtering

Open omnichronous opened this issue 1 year ago • 4 comments

Describe the feature request

Thank you for your work Unleash team. Is it possible to port the functionality from https://github.com/Unleash/unleash-client-node/pull/237 into this SDK too?

Background

I have a codebase with multiple projects that sometimes share feature toggles and sometimes not. I'd like to be able to use tags in the Unleash Admin to designate which project uses which toggles and then in each project fetch only those toggles that are relevant to it.

Solution suggestions

No response

omnichronous avatar Aug 02 '23 15:08 omnichronous

Hey @omnichronous, this probably isn't on our radar right now. You're more than welcome to take a stab at a PR but we have other high priority changes that we're focusing on.

What problem is this actually causing for you? Are you trying to reduce network overhead here?

sighphyre avatar Aug 23 '23 07:08 sighphyre

Thanks for your response @sighphyre. Yeah reducing network overhead is part of it, and another part is security - the same logic as returning only the currently enabled toggles when the client does a fetch.

What I'm really trying to do is integrate Unleash with my analytics solution. I want to create a "set it and forget it" mechanism to include the Unleash state in every event that's reported to my analytics tool. When that difference between 10 and 20 toggles gets multiplied by thousands and thousands of events it starts to have a real impact. That's why I'd like a way to filter out some of the toggles on the client side.

Even just getting the tags in the client would solve this for me, but I figured porting this functionality from the other SDK would be easier.

omnichronous avatar Aug 30 '23 08:08 omnichronous

@omnichronous Ah, you have a fairly unusual use case here. Have you seen this: https://docs.getunleash.io/reference/impression-data that's usually how I would recommend approaching that problem, but that probably won't work if you need the entire snapshot.

What you're saying makes sense and we're very open to adding the feature but we have quite a lot of high priority things that we need to tackle before we focus on this. We'd be more than open to accepting a PR if you need it and you're willing to give it a shot?

sighphyre avatar Sep 04 '23 13:09 sighphyre

Related to this, is there a way to only request toggles for a specific project? It doesn't look like it.

Aaronius avatar May 01 '24 20:05 Aaronius

Related to this, is there a way to only request toggles for a specific project? It doesn't look like it.

Yes, as long as you use a project specific token together with the Unleash Frontend API or the Unleash Edge you will only get toggles for that project.

ivarconr avatar May 06 '24 18:05 ivarconr

I am closing this as you can achieve the same goal with scoped API tokens.

ivarconr avatar May 06 '24 19:05 ivarconr