Hi Conrad,
What I think might work in your case is to have a look at the HTML Serializer, this is what is used to turn the Prismic Rich Text data in to HTML in your front end application.
You could import the application state in to this file and using some sort of variable declaration like you suggested above, you could parse the object and add the user data. I'm guessing this is what you were suggesting. Other than that I can't think of any other way to do this.
Let me know what you think.
Thanks.