Set user agent

Set a custom user agent on a BigQuery client.

Code sample


Before trying this sample, follow the Node.js setup instructions in the BigQuery quickstart using client libraries. For more information, see the BigQuery Node.js API reference documentation.

// Import the Google Cloud client library
const {BigQuery} = require('@google-cloud/bigquery');
// Create a client and set the user agent
const bigquery = new BigQuery({userAgent: 'my-user-agent'});

console.log('User agent:');

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.