Accessing Okta context info from frontend? (node, express, OIDC middleware)

Hi, not sure if this is a stupid question but is there a way to directly access info about the logged in user from the frontend?

I have an application running on express on node.js using your OIDC middleware extremely similar to this example:

We are rendering the frontend using server-side rendering on EJS engine.

With every request I can access user info (like names,email address etc) under req.userContext.userinfo on the server side, exactly like in the example

If I want to display this data on a page (like their name) I can just pass this stuff into the page from the server, again like the example. This is fine but I was wondering if there is a way of accessing it from the frontend directly (within a script tag) without having to pass it in from the server?