In APIs & Services → Library, enable Google Drive API and Google Picker API.
In OAuth consent screen: choose External, fill app name, add your email under Test users.
In Credentials → Create credentials → OAuth client ID → type Web application. Under Authorized JavaScript origins add the exact URL you'll open this app from, e.g. https://yourapp.pages.dev (and http://localhost:8000 for testing).
Copy the Client ID. Then Create credentials → API key, copy it too.
✦
BetterDrive
Your drive · Rebuilt beautiful
BetterDrive only sees files you upload through it or folders you explicitly link. Nothing else on your Drive is touched.