Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve picker docs #318

Merged
merged 3 commits into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions docs/sources/companion-plugins/google-drive-picker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,22 @@ Create a project for your app if you don’t have one yet.
- On the project’s dashboard, enable the
[Google Picker API](https://console.cloud.google.com/apis/library/picker.googleapis.com)
(for Google Drive).
- Create an API key. Restrict your API key to the Google Picker API for safety.
This will be your `apiKey` in Uppy.
- Create an OAuth 2.0 Client ID of type Web application with the correct
Authorized JavaScript origins. This will be your `clientId` in Uppy.
- Create an API key:
- Application restrictions: _Websites_
- Website restrictions: Add the base URL of the domain name you’re hosting the
**frontend web app** on, example: `https://example.com`. Note that if you’re
testing locally you need to add `http://localhost:LOCAL_PORT` or similar
- API restrictions: Restrict key: Tick _Google Picker API_
- Click _Show key_ and use it as the `apiKey` argument to Uppy.
- Create an OAuth 2.0 Client ID of type Web application:
- Authorized JavaScript origins: Add the base URL of the domain name you’re
hosting the **frontend web app** on, example: `https://example.com`. Note
that if you’re testing locally you need to add `http://localhost:LOCAL_PORT`
or similar. This will be your `clientId` in Uppy.
- For how to find `appId`, [see options below.](#appid)
- Some users reported that the
[Google Drive API](https://console.cloud.google.com/marketplace/product/google/drive.googleapis.com?q=search&referrer=search)
must be enabled as well, so if you’re having problems, please try that.

### Use in Uppy

Expand Down Expand Up @@ -146,8 +158,15 @@ The API key from the [Initial setup](#initial-setup) (`string`).
#### `appId`

The App ID can be found in the
[Google Developer Console](https://console.developers.google.com)
`Project number` under `IAM & Admin` > `Settings`. Note that if this is set to
an invalid value it will be ignored by Google when your project is in testing
mode, but once in production you will get 404 errors when trying to download
files.
[Google Developer Console](https://console.developers.google.com): _Project
number_ under
[`IAM & Admin` > `Settings`](https://console.cloud.google.com/iam-admin/settings).

:::note

Make sure you use the **project number** (**not** project ID or project name),
and make sure you’re in the correct project. Note that if this is set to the
wrong value it will be ignored by Google when your project is in testing mode,
but once in production users will get 404 errors when trying to download.

:::