mongodb-slow-operations-profiler icon indicating copy to clipboard operation
mongodb-slow-operations-profiler copied to clipboard

Api says to give credential like merchant id in json file

Open way2enjoy2 opened this issue 5 years ago • 1 comments

We were tryjng to use this api. We got merchant id after oauth2 approval from customers but how can we use this api if we have to use json file. I want to manage our customers Google shopping feed so i want to pass merchant id and access token from database but this library seems to be asking us to input merchant id in json file. With that approach i can only manage one client . I am very sure i dont know something basic otherwise Google will never design something which is for ond customers. So my apologies. I learn from you guys

Any help on how can we use this library for thousands oc customers by passing data straight from database will be great

way2enjoy2 avatar Jul 26 '20 02:07 way2enjoy2

The node client library accepts a parameter called keyFile. So you would use like this:

  const auth = new google.auth.GoogleAuth({
    keyFile: './service-account.json',
    // Scopes can be specified either as an array or as a single, space-delimited string.
    scopes: ['https://www.googleapis.com/auth/content']
  });
  const authClient = await auth.getClient();
  const content = google.content({
    version: 'v2.1',
    auth: authClient
  });

pbassut avatar Sep 27 '20 16:09 pbassut