# VDO.Ninja Cloud Sync Setup

## Google Drive (built-in OAuth)

1. Open the podcast studio (`?studio=podcast`) and locate the Cloud Sync card.
2. Click Link Google Drive. Google Identity Services opens a popup window.
3. Pick the Google account that will own the uploads and approve the `drive.file` scope.
4. Once the popup closes, the status pill switches to “Linked” and future recordings stream into your Drive root (or the custom folder configured via `&gdrivefolder=YourFolder`).

The Drive token stays in the browser session. Re-click the button whenever the token expires or if you switch accounts.

## Dropbox (OAuth + refresh tokens)

The Dropbox integration now mirrors the Google Drive workflow: clicking Link Dropbox opens an OAuth popup, requests the `files.content.write` / `files.metadata.write` scopes, and stores a refresh token locally so future sessions can renew access automatically. No server-side helpers are required—the entire exchange happens in your browser.

### Authorize via OAuth

1. Open the podcast studio (`?studio=podcast`) and scroll to the Cloud Sync card.
2. Click Link Dropbox. Allow the popup (make sure your browser isn’t blocking it).
3. Sign in with the Dropbox account that should receive uploads and approve the requested scopes. The popup will close once the code exchange completes.
4. The studio status should switch to “Dropbox linked. Recordings will upload automatically.”

Tokens never leave your browser. We store the refresh token (and the most recent short-lived access token) inside `localStorage` so background uploads can reconnect silently even after several hours.

### Manual fallback token (optional)

If you need an emergency override—e.g., when the OAuth popup cannot run inside a kiosk build—you can still paste a personal access token into the Dropbox field:

1. Visit https://www.dropbox.com/developers/apps, open your scoped app, and click Generate access token.
2. Copy the token, paste it into the Cloud Sync token box, then click Link Dropbox.
3. You can also launch the studio with `?dropbox=YOUR_TOKEN`; the textbox will populate automatically.

Dropbox’s generated tokens expire quickly (typically ~4 hours) and do not refresh. Prefer the OAuth link unless you’re temporarily sidestepping browser restrictions.