mongodb-slow-operations-profiler
mongodb-slow-operations-profiler copied to clipboard
Api says to give credential like merchant id in json file
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
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
});