Hello Daniele Alessandra, thanks for your response.
Currently, the Da Reaction plugin identifies the user by User ID (if they are logged in) or by a token (stored in the user’s cookies).
My use case is a little different. I’m developing a Headless WordPress App with Next.js, and I have a .NET backend that contains all our user data. So, my stack is as follows:
- Next.js: as the frontend application.
- .NET: as my backend with a database containing all my users’ info.
- WordPress: as the content management system for content writers to write articles.
I want to identify users when they like a post, but I don’t want to log my users into WordPress. So, according to the plugin’s current implementation, all my users are anonymous.
My solution to identify my users was this: passing the User ID from my Next.js server to the Da Reaction Endpoint.
To prevent unauthorized actions, I will add some kind of API Key that is only known to the WordPress backend and Next.js, and pass it as a header with my request along with the User ID (after verifying the user) using my Next.js server.
I’m new to WordPress and the Headless approach. What do you think of this? Also, I’m not completely sure if the Da Reaction package plays nicely with Headless WordPress. I just played with it.