- I run
createInstance on both server and client to get optimizely client.
- I run
client.setUser({ id: userId }) with the same user id and attributes on both server and client.
- I use
<OptimizelyProvider optimizely={client} user={{ id: userId }}> and both server (with isServerSide prop) and client.
- I use
useDecision hook on both server and client and use the derived decision to render true or false if feature flag is disabled or not.
- Sometimes I get the mismatch between SSR and CSR.
I have tried to run client.decideAll() to get serialisable decisions on the server and tried to supply it to client-side created instance of the client, but I could not find a way to do it. Can you help?
createInstanceon both server and client to get optimizelyclient.client.setUser({ id: userId })with the same user id and attributes on both server and client.<OptimizelyProvider optimizely={client} user={{ id: userId }}>and both server (withisServerSideprop) and client.useDecisionhook on both server and client and use the deriveddecisionto rendertrueorfalseif feature flag is disabled or not.I have tried to run
client.decideAll()to get serialisable decisions on the server and tried to supply it to client-side created instance of the client, but I could not find a way to do it. Can you help?