← Back to Lofi Focus

Connect Google Drive & Calendar

Lofi Focus is a page with no server behind it, so Google needs to know about your copy before it can sign you in. You do this once, in a free Google Cloud project. It takes about 10–15 minutes.

FreeOne-time setupNo client secret neededOnly Drive files the app creates
1

Create a project and turn on the APIs

In console.cloud.google.com

  1. Sign in with the Google account you'll use, then use the project picker at the top to create a New project (for example, “Lofi Focus”).
  2. Go to APIs & Services → Library and enable both the Google Drive API and the Google Calendar API.
💡

Google moved the sign-in settings into a section called Google Auth Platform, which has Branding, Audience, Data Access and Clients tabs. Older guides call these “OAuth consent screen” and “Credentials”.

2

Fill in Branding

Google Auth Platform → Branding

This is what people see on Google's sign-in screen. Fill in each field exactly as shown, then click Save at the very bottom of the page.

App name
Lofi Focus
User support emailClick the box and pick your own email address from the list that appears.
App logoDon't upload anything. A logo means Google has to review your app before it can be published.
Application home page
https://your-site
Application privacy policy link
https://your-site/privacy.html
This page comes with Lofi Focus.
Application terms of service linkLeave empty.
Authorized domainsClick + Add domain, paste this, and press Enter:
your-domain.com
Developer contact informationType your own email address and press Enter.
⚠️

If publishing later says “you must complete your configuration on the Branding page”, one of these is missing (usually the privacy policy link), a logo is uploaded, or the page wasn't saved.

3

Choose who can sign in

Google Auth Platform → Audience

Set the User type to External. (If your project belongs to a work or school organisation, still pick External. Internal rejects personal @gmail.com accounts.) Then pick one:

🔒 Just me (and a few people)

Leave the app in Testing and add each person's Google address under Test users, typed in lowercase. There's a limit of 100.

👋 Friends, without a list

Click Publish app. Anyone with a Google account can sign in, up to 100 people while the app is unverified.

Either way, the first time someone signs in, Google shows “Google hasn't verified this app”. That's expected for a personal app. Click Advanced → Go to your site (unsafe) to continue. It only appears because the app asks for calendar access, which Google counts as sensitive. Getting rid of the screen requires Google's formal review, which isn't worth it for a personal tool.

4

Add the two permissions

Google Auth Platform → Data Access → Add or remove scopes

These are the only permissions Lofi Focus ever asks for:

…/auth/drive.fileLets the app see and save only the files it created itself, in a Lofi Focus folder, never the rest of your Drive.
…/auth/calendar.eventsLets the app show your events in its calendar and, if you choose, add finished focus sessions.

Search for them by name in the scope picker, tick both, click Update, then Save.

5

Create the Web client

Google Auth Platform → Clients

  1. Click + Create client at the top of the page.
  2. Application type: open the dropdown and choose Web application.
  3. Name: enter
    Lofi Focus web
  4. Under Authorized JavaScript origins, click + Add URI and paste this site's address:
    …
    Paste it exactly: starting with https://, with nothing after it, and no slash at the end.
  5. Authorized redirect URIs: don't add anything. Leave it empty.
  6. Click Create. A box titled OAuth client created appears. Click the copy icon next to Client ID. It looks like 123456789012-a1b2c3d4e5f6.apps.googleusercontent.com. Don't use the Client secret; Lofi Focus never needs it.
💡

Also running Lofi Focus on your own computer? Repeat the + Add URI step with http://localhost:8080 (use your real port if it's different). Google treats every address separately, and changes can take up to 5 minutes to work.

6

Paste your Client ID

Here, or in Lofi Focus → Settings → Google → Google setup

This saves it for this browser. To make it work for everyone who uses your copy, put it in js/config.js as googleClientId: '…' instead.

Then go back to Lofi Focus and try Settings → Save to Drive, or Connect in the Calendar. You can take back access any time at myaccount.google.com/permissions.

?

Troubleshooting

Error 401: invalid_client “no registered origin”

This page's exact address isn't in Authorized JavaScript origins (step 5). Check http vs https, the port, a slash at the end, and localhost vs 127.0.0.1.

Also check the Client ID: no quotes or spaces, and it must be the Client ID, not the client secret.

Error 403: access_denied “has not completed the Google verification process”

The app is in Testing and this Google account isn't a Test user. Add the account (step 3), or publish the app.

“Google hasn't verified this app”

That's expected. Click Advanced → Go to … (unsafe). It's your own app.

“Ineligible accounts not added” when adding a test user

The audience is set to Internal (switch to External), or the address has a typo or trailing space. Group addresses, aliases and supervised (child) accounts can't be test users.

Nothing happens when I click Save to Drive or Connect

Your browser may have blocked the sign-in popup. Allow popups for this site.

An ad or privacy blocker (uBlock Origin, AdGuard, Privacy Badger, Brave Shields) may be blocking accounts.google.com. In the browser console this shows as net::ERR_BLOCKED_BY_CLIENT. Allow this site in the blocker, or try a private window.

“You must complete your configuration on the Branding page”

A required Branding field is empty (often the privacy policy link), a logo is uploaded, or the page wasn't saved at the bottom. See step 2.

Console messages I can ignore

Blocked doubleclick.net or googleads requests are ads inside the YouTube player being stopped by an ad blocker.

“The AudioContext was not allowed to start” is expected: browsers only allow sound after your first click, and Lofi Focus starts audio on that click.