E
E
Evgeny Koryakin2019-04-07 09:08:02
RESTful API
Evgeny Koryakin, 2019-04-07 09:08:02

What methods to save WooCommerce API authorization exist?

Hello.
I tried to pass API authorization from under React with two methods:

const wp = new WPAPI({
    endpoint: 'https://site',
    username: 'user',
    password: 'pass'
});

and
const WooCommerce = new WooCommerceAPI({
  url: 'https://site', // Your store URL
  consumerKey: 'ck_65d32afa5c7243900115f9ac8da877bcd436e517', // Your consumer key
  consumerSecret: 'cs_65e8a9e9d16762e3aae880478ba595ad59f04841', // Your consumer secret
  wpAPI: 'true',
  version: 'wc/v3' // WooCommerce WP REST API version
});

And if I authorize on the server through PHP and continue to work with React under the same IP and on the same server, will the authorization remain?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question