izanami icon indicating copy to clipboard operation
izanami copied to clipboard

How to manage features per customer?

Open yuriron opened this issue 7 years ago • 9 comments

I played with the product and found it very useful from dev team point of view, however we have open questions from product team:

  1. Is there any possibility to enable feature per customer not from script, but from dedicated page?
  2. Is there any option to see all features enabled\disabled per customer?

yuriron avatar Apr 16 '19 06:04 yuriron

Hi, Sorry I'am answering a bit late. I don't really know the use case but may be you can create features with

  • feature:client:id1
  • feature:client:id2
  • ...
  • feature:client:idn

So you can enable and disable features per client.

larousso avatar Jul 08 '19 15:07 larousso

You could feed a context into the feature request with a client name variable inside. Then use a script to enable the feature for select clients in the Izanami web UI.

SoerenSilkjaer avatar Oct 22 '20 17:10 SoerenSilkjaer

@SoerenSilkjaer I'm trying to achieve this, and I guess this is the best way to do it. However I'm not able to pass/feed the context to the fetch request. Do you have a code sample of how to do that on the React side?

Here's what I tried to do: On React side, for the fetch, I added context as a body body: JSON.stringify({ context: { user: '[email protected]' } })

Then on Izanami web UI feature I used Script Strategy:

function enabled(context, enabled, disabled, http) {
  if (context.user === '[email protected]') {
    return enabled();
  }
  return disabled();
}

But that didn't work, also tried having the body like this: body: JSON.stringify({ user: '[email protected]' })

wasim-abuzaher avatar Dec 29 '20 06:12 wasim-abuzaher

@wasim-abuzaher I am not familiar with the react client, i think @pierrebruninmaif or @larousso are better suited to help you out here.

SoerenSilkjaer avatar Dec 29 '20 11:12 SoerenSilkjaer

Hi,

Your react app should talk to your backend and your backend talk to Izanami with a proxy. Do you forward the context with the proxy ? If you're not doing it like this, could you explain your architecture ?

larousso avatar Dec 29 '20 11:12 larousso

Your first demand is related to https://github.com/MAIF/izanami/issues/475 This is not done yet but it will be a new strategy

larousso avatar Dec 29 '20 12:12 larousso

Was just brought onto this project and never worked with Izanami before, so not sure. There's probably a backend+proxy, I'll check and get back to you.

But really thanks for the quick reply

wasim-abuzaher avatar Dec 30 '20 02:12 wasim-abuzaher

@wasim-abuzaher I don't think that you can provide context from react as it is now. I've started some work in #491 to allow more configurability in the express proxy, as it is a bit limited as it is.

jtanguy avatar Dec 30 '20 16:12 jtanguy

I was able to pass context through the request headers to a nest proxy, do some processing there and pass it as context to Izanami.

Thanks for the support and pointing me in the right direction

wasim-abuzaher avatar Jan 05 '21 16:01 wasim-abuzaher