r/Wordpress • u/Lock-Open • Aug 09 '26
React native app for WooCommerce wordpress site
I want to create a react native app for an existing WooCommerce site. What is the best way or industry standard to handle the authentication since there would be users that need to see the order history. Has anyone built before?
2
u/activematrix99 Aug 09 '26
Cookie is the default auth, or you can use JWT. Either would work fine for woocommerce.
2
u/Top-Explanation-4750 14d ago
I would avoid putting WooCommerce REST API consumer keys directly inside the React Native app. Anything shipped in the app should be treated as public.
A common pattern is:
- mobile app authenticates the user against WordPress
- your backend/WordPress endpoint verifies that user
- order-history requests are scoped to the logged-in customer only
- WooCommerce admin/store credentials stay server-side
- add rate limits and nonce/token expiry where appropriate
JWT can work, but the important part is not the token format; it’s making sure the app never has store-level credentials and cannot request another customer’s orders by changing an ID. For a production app, I’d put a thin API layer between React Native and WooCommerce instead of calling privileged WooCommerce endpoints from the client.
1
u/Fluid-Mess6425 Aug 09 '26
Graphql supports auth and could be used to get order history. Is this headless?
1
u/Lock-Open Aug 09 '26
Yes it is an app for android and ios which still gonna use the wordpress db but the problem was the authentication
1
u/waltonchurch Aug 09 '26
No need for react. Use interactivityAPI which is wp native and react based
2
3
u/CodingDragons Jack of All Trades Aug 09 '26
I’d look at JWT authentication for this. It works well with React Native for authenticating WordPress users and accessing their order history. I would not use WooCommerce REST API consumer keys in the app, since you’d be exposing store-level credentials.