Using Woocommerce as backend & ReactJS as frontend? Using Woocommerce as backend & ReactJS as frontend? wordpress wordpress

Using Woocommerce as backend & ReactJS as frontend?


WooCommerce provides REST API which you can use to power your frontend. However for that you need to provide consumer key and consumer secret to your frontend, which is not a good idea security-wise, so it is ideal to create a API proxy and make the frontend communicate with the proxy which then routes the calls to the actual API using the key and secret.


First of all you have to create API keys:

  1. To start using REST API, you first need to generate API keys.

  2. Go to WooCommerce > Settings > Advanced

  3. Go to the REST API tab and click Add key.

  4. Give the key a description for your own reference,

  5. Choose a user with access to orders etc.

  6. Give the key read/write permissions.

  7. Click Generate API key.

  8. Your keys will be shown

  9. Do not close this tab yet, the secret will be hidden if you try to view the key again.

You can use the following guides:

React + WordPress

woocommerce-rest-api

Maybe you need to allow the CORS too, use this guid

Finally better to use JWT-authentication in addition to API KEY.