Step 4: Run the sample

Run the sample using the following command:

node quickstart.js

The first time you run the sample, it will prompt you to authorize access:

Browse to the provided URL in your web browser.

If you are not already logged into your Google account, you will be
prompted to log in. If you are logged into multiple Google accounts, you
will be asked to select one account to use for the authorization.

Click the Accept button.

Copy the code you're given, paste it into the command-line prompt, and press
Enter.

Great! Check out the further reading section below to learn more.
Bummer.
Let us know what went wrong and we'll work to fix this quickstart.

Notes

Authorization information is stored on the file system, so subsequent
executions will not prompt for authorization.

The authorization flow in this example is designed for a command line
application. For information on how to perform authorization in a web
application that uses the YouTube Data API, see
Using OAuth 2.0 for Web Server Applications.