How to manage features per customer?
I played with the product and found it very useful from dev team point of view, however we have open questions from product team:
- Is there any possibility to enable feature per customer not from script, but from dedicated page?
- Is there any option to see all features enabled\disabled per customer?
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.
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 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 I am not familiar with the react client, i think @pierrebruninmaif or @larousso are better suited to help you out here.
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 ?
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
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 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.
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