It finally worked!
After putting the code on server side, there was a minor issue on UI while rendering the JSON context output. Simply using JSON.stringify(context) worked for me.
In addition to that, I found this post helpful in understanding how context gets passed around from frontend to backend : Rendering UI kit from a Custom UI resolver function
@dmorrow thanks for helping me out!
2 Likes