re: Headless WordPress with React VIEW POST


I am been doing something very similar with Polymer and Wordpress. Restricting the Wordpress CMS to just content has been having huge performance impacts for some of my projects.


How did you do the authentication and how did you bring the nonces into your Polymer app?
I am working on also with Polymer and Wordpress but I have no idea how I can get the nonce into my app.


Hey! From the Codex:

For developers making manual Ajax requests, the nonce will need to be passed with each request. The API uses nonces with the action set to wp_rest. These can then be passed to the API via the _wpnonce data parameter (either POST data or in the query for GET requests), or via the X-WP-Nonce header.

More here: developer.wordpress.org/rest-api/u...

Yes I read that already, had already tested it and it works. But I wonder how I can pass the generated nonce from WP to my app, if it is completely independent from my Wordpress installation, e.g. the app is in a different directory / subdomain as Wordpress.

That's a good question! I'll look into that and see if I can write a post on it.


Code of Conduct Report abuse