MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

retail/quickstart.js:16–37  ·  view source on GitHub ↗
(projectId, location)

Source from the content-addressed store, hash-verified

14'use strict';
15
16async function main(projectId, location) {
17 // [START nodejs_retail_quickstart]
18
19 // Imports the Google Cloud client library
20 const {CatalogServiceClient} = require('@google-cloud/retail');
21
22 // TODO(developer): uncomment these variables with your information
23 // const projectId = 'my-project'
24 // const location = 'global'
25
26 // Creates a client
27 const client = new CatalogServiceClient();
28
29 async function listCatalogs() {
30 const catalogs = await client.listCatalogs({
31 parent: `projects/${projectId}/locations/${location}`,
32 });
33 console.info(catalogs);
34 }
35 listCatalogs();
36 // [END nodejs_retail_quickstart]
37}
38
39main(...process.argv.slice(2)).catch(err => {
40 console.error(err.message);

Callers 1

quickstart.jsFile · 0.70

Calls 1

listCatalogsFunction · 0.85

Tested by

no test coverage detected