Hello, dear community and growthbook users. I enco...
# ask-questions
m
Hello, dear community and growthbook users. I encountered the following issue while using growthbook, the self-hosted version. I need to synchronize the client and backend, specifically the user on the client side and the user on the backend.I mean that for the proper functioning of experiments and feature flags, the user on the backend and frontend needs to be initialized with the same number and values of attributes. However, due to certain circumstances, we don't have all the user attributes on the client side that are available on the backend. As a result, we can't initialize the user on the frontend with the same set of attributes. I have two potential solutions for this problem. The first solution is to proxy the initialization of growthbook through our backend, meaning not to use the growthbook SDK on the frontend but to handle it on our backend. The second option is to send all the necessary attributes for the user from the backend to the frontend for initialization. However, the second option doesn't seem very secure, as sensitive data might be stored in these attributes. Alternatively, there might be a third solution that I'm not aware of, and I want to ask how you handle this problem. Thanks!
r
Hi VL! It sound like you're on the right track in your solutions. - We do have a proxy available that may be helpful - Additionally, there's also an edge worker that may also fit your needs - Remote evaluation, which works with the proxy/front-end SDK, evaluates feature flags only on the server and avoids sending any private data - One final feature to know about is secure attributes. They offer some level of obfuscation of attribute values. I know that's a lot! Please let me know if you have other questions.
m
Thanks, Actually we are already using proxy, but seems its not a solution. Remote Evaluation could be, but I don’t understand how to use it right. So again: is there a way frontend WILL NOT init growbook with any attributes anywhere? But when frontend init - growthbook will go to our backend and asks for attributes for the specified user is trying to init?
r
You can init GrowthBook with your own set of attributes. However, these attributes need to be present because they are how GrowthBook determines the value of feature flags/experiments.