Set up Google sign-in
Bothy has no server, so it signs in to Google Drive with an OAuth client of your own Google Cloud project. You do this once; it takes about ten minutes and costs nothing.
-
Create a project. Open the Google Cloud console, name it (for example
my-notes-sync) and create it. -
Enable the Google Drive API. In the project, open APIs & Services → Library → Google Drive API and click Enable.
-
Configure the consent screen. Open Google Auth Platform (the OAuth consent screen):
- user type External;
- app name and your email;
- under Audience → Test users, add the Google accounts that will sign in.
-
Add the scopes. Under Data access, add:
https://www.googleapis.com/auth/drive.appdata: the hidden per-app folder;https://www.googleapis.com/auth/drive.file: a visibleBothy/<name>folder, needed for headless devices.
Both are non-sensitive, so Google does not review them.
-
Create the clients. Under Clients → Create client, create what you need and download each JSON file:
Client type Used by Settings Desktop app CLI, macOS, Linux and Windows apps none TVs and Limited Input devices headless boards (device code sign-in) none Android Android apps package name and the SHA-1 of the signing key Web application Android apps (as the “server client id”) no redirect URIs iOS iOS apps bundle id -
Hand the clients to Bothy. For the CLI:
Terminal window bothy auth setup --client ~/Downloads/client_secret_desktop.jsonbothy auth setup --device-client ~/Downloads/client_secret_tv.json # optionalbothy auth loginFor apps, see the Flutter guide and the Python guide.
Things that go wrong
Section titled “Things that go wrong”- “Access blocked” or “not a test user”: add the account under Audience → Test users.
accessNotConfiguredor “Google Drive API has not been used in project…”: the Drive API is not enabled for the project of this client (step 2).- Signed out after a week: while the consent screen is in Testing, Google expires sign-ins after 7 days. Sign in again, or publish the app (In production). An unverified app shows a warning screen at sign-in, which is fine for your own project.
- The other device sees nothing: check that both use clients of the same project, and that
both chose the same remote (
appdataor the samefolder:<name>). - A headless board cannot join: Google refuses the
drive.appdatascope in the device code flow, so headless devices can only use folder databases. Create the database with--remote folder:<name>if a board will ever join it.