How does one request additional scopes using google-auth-library with npm?

Our UI currently prompts the user to login with default scopes enabled.
In order to support a specific feature in our application, we’d like to request additional permissions only if they opt-in for the feature.

This link from Google explains how to do exactly that, but it uses their old javascript library that’s no longer supported.
How can I achieve the same thing with google-auth-library?