Google Drive sync — one-time setup
You supply your own Google Cloud OAuth credentials. The server keeps the OAuth app
credentials in ./.data/app/google-oauth.json and, per user who clicks Connect
server to Google Drive, a Drive grant in ./.data/app/users/<userId>/google-token.json
(both 0o600).
There are two ways to supply the OAuth credentials: in-app (recommended — no restart) or via environment variables.
1. Create OAuth credentials
- Open the Google Cloud Console and create (or pick) a project.
- APIs & Services → Library → enable Google Drive API.
- APIs & Services → OAuth consent screen: choose External, add yourself as a
Test user. Scope needed:
https://www.googleapis.com/auth/drive.file— this lets Flowline manage only the files it creates, and (unlike the fullauth/drivescope) it is not a restricted scope, so it needs no Google verification or CASA security assessment to publish. - APIs & Services → Credentials → Create credentials → OAuth client ID:
- Application type: Web application.
- Authorized redirect URI:
http://localhost:8787/api/drive/auth/callback(matchPORTif you changed it).
- Copy the Client ID and Client secret.
2a. Configure in the app (recommended)
- In the Workspace picker, click Connect Google Drive. If no OAuth app is configured yet, a Set up Google OAuth form appears.
- Paste your Client ID and Client Secret and click Save OAuth App.
The credentials persist to
./.data/app/google-oauth.json. - The Connect button is now enabled — see step 3 below.
2b. Or configure via environment variables
Set these before starting the API server (persisted in-app credentials, if any, take precedence over these):
export GOOGLE_CLIENT_ID="xxxx.apps.googleusercontent.com"
export GOOGLE_CLIENT_SECRET="xxxx"
# optional overrides:
# export GOOGLE_REDIRECT_URI="http://localhost:8787/api/drive/auth/callback"
# export GOOGLE_PICKER_API_KEY="..." # enables Choose Drive folder / Create new folder
npm run dev # web + api together (or `npm run dev:api` for the API only)
The /api/drive routes are always mounted now. When no OAuth app is configured,
the connect flow returns a clear "not configured" message (instead of a 404) and
the in-app setup form is shown.
3. Connect and add a Drive workspace
- On the workspace picker, click Connect Google Drive and name the workspace.
- Click Choose Drive folder or Create new folder (both need a Picker API
key), or open Advanced: add by folder id, paste a Drive folder link (e.g.
https://drive.google.com/drive/folders/<id>) or a raw folder id, and click Add. - To let MCP reach the workspace, click Connect server to Google Drive under Server access (MCP).
How it works
- The browser reads and writes the Drive folder directly with its own token. Each project is a folder of small JSON files, one per item (layout); there is no Pull or Push.
- The browser follows Drive's change feed to see teammates' edits, and checks a fresh folder listing before every save, so a save never overwrites a file that changed since you read it (Working as a team).
- File contents are cached in the browser's IndexedDB, so a reload reads only what changed. A project folder unused for 30 days drops out of the cache.
- Shared drives are not supported: the listing and the change feed don't request them.