Streaming live at 10am (PST)

Javascript - Get currently authenticated user's data

We have a site that is being converted from wordpress to webflow. In addition to wordpress, the site also relies on a PHP back-end that I coded for the AJAX content on certain pages. Of course PHP will not run on webflow so I was planning to move my API to a subdomain such as That way, Javascript running in webflow pages can still get data from my API. The following text taken from our Slack explains the rest:

It’s not about wordpress. Our API (Which I coded) is in PHP. It is responsible for supplying data to the user interface. This works by some code on the wordpress page making an HTTP request to my API. Since the user is logged into WP and since my API is able to include a special WP file that allows it to interact with the WP install (Possible since both my API and WP are on the same server), my API can check to see if the user is logged into WP and if they have paid.

In the case of webflow, I would have to put my API on a different subdomain since the main site and API will no longer be hosted on the same server. That way, pages can still make HTTP requests to the API. Easy enough but now that they are no longer on the same server, there is no file (Like the WP file) to include in my code that will enable getting a user’s logged in and payment status.

Usually, the way to accommodate this would be having my API connect back to webflow’s API upon each request to verify user status. They do have an API but upon further inspection, I don’t see any API methods for getting the currently logged in user’s authentication status or membership: API seems very limited and is therefor giving me cause for some concern.

In summary, I know I can include javascript in webflow pages and make calls to the webflow API from my PHP (Hosted elsewhere) but how can I send what’s needed to query information from the webflow API about the currently logged in user specifically, from the javascript on a webflow page?