Why use this workflow
Embedding the Google editor keeps the source of truth in Google Workspace. Users can keep using familiar Docs, Sheets, and Slides editing tools while your Lovable app adds the product experience around the file. This works well for lightweight internal tools, review flows, spreadsheet-powered dashboards, document copilots, and slide deck helpers.Common use cases and example apps
| Use case | What the Lovable app adds | Google file to embed |
|---|---|---|
| Document review workspace | Comments, AI summaries, checklists, or handoff buttons around a Doc | Google Docs |
| Sheet-powered operations tool | Custom filters, side panels, or actions beside the live Sheet | Google Sheets |
| Pitch deck assistant | Prompt controls, notes, or asset generation beside a deck | Google Slides |
| Internal planning hub | A file selector with the selected Google editor on the page | Docs, Sheets, or Slides |
Prerequisites
- A Google account with access to the file
- A Lovable project where you want to embed the file
- Google Workspace connectors if the app needs to read, write, create, or list Google files through APIs
- Sharing settings that allow the people using the app to view or edit the Google file
The iframe uses the viewer’s browser session with Google. The Google Workspace connector is separate and is only needed when your app code needs to call Google APIs, such as reading Sheet rows, creating a Doc, or updating Slides.
Set up Google Workspace connectors
If your app only embeds a known Google file, you may not need a connector. If your app reads, writes, creates, lists, or updates Google files, connect the relevant Google Workspace service first.Connect the Google services you need
Add the relevant Google Workspace connections, such as Google Docs, Google Sheets, Google Slides, and Google Drive.Use Google Drive when the app needs to list files, choose files, create files in folders, or manage file metadata.
Authorize the right Google account
Sign in with the Google account that should own or access the files. Each connection is tied to the account that authorizes it.
Use the right iframe URL
For direct editing, ask Lovable to use the Google editor URL with/edit. Avoid /preview, /view, /pub, and published-to-web URLs when the goal is editing in place.
| File type | Editable iframe URL pattern |
|---|---|
| Google Docs | https://docs.google.com/document/d/FILE_ID/edit?usp=sharing |
| Google Sheets | https://docs.google.com/spreadsheets/d/FILE_ID/edit?usp=sharing |
| Google Slides | https://docs.google.com/presentation/d/FILE_ID/edit?usp=sharing |
- Docs: keep
tab=...if the link includes a tab parameter. - Sheets: keep
gid=...orrange=...when you want to open a specific sheet or range. - Slides: keep
slide=...if you want to open a specific slide.
Copyable knowledge file
Paste this into project knowledge, workspace knowledge, or a focused skill when your team frequently builds Google Workspace editing apps.Best practices
- Start from the pasted Google URL. Parse the file ID and preserve useful parameters instead of asking the user to find the ID manually.
- Prefer split panes. Put the Google editor on one side and the Lovable-built controls on the other.
- Use connectors for data operations. For example, read Sheet rows through the Google Sheets connector, then show the Sheet iframe for manual review.
- Respect sharing settings. Ask before changing file visibility, and avoid making private files public unless the user explicitly requests it.
- Keep the fallback visible. An external link avoids dead ends when Google requires sign-in or blocks iframe behavior.
Limitations
- Google controls whether its editor loads inside an iframe. Users may need to sign in, accept cookies, or open the file in a new tab.
- The iframe does not give your app direct access to document contents. Use the Google Workspace connectors when your app needs structured access.
- The connected Google account owns or accesses files created through the connector. Make sure you authorize the account you want to use.
- Published apps can expose embedded links to anyone who can access the app. Keep Google sharing permissions aligned with the app audience.
FAQ
Do I need a Google Workspace connector just to show an editable iframe?
Do I need a Google Workspace connector just to show an editable iframe?
No. The iframe loads through the user’s browser and Google session. Use a connector when your app needs to call Google APIs, such as reading Sheet rows, creating Docs, or updating Slides.
Which Google URL should I use for editing?
Which Google URL should I use for editing?
Use the normal Google editor URL with
/edit, such as https://docs.google.com/document/d/FILE_ID/edit?usp=sharing. Avoid preview, view-only, and published URLs when you want users to edit directly.Why does the iframe show a sign-in screen or fail to load?
Why does the iframe show a sign-in screen or fail to load?
Google controls sign-in and iframe behavior. The viewer may need to sign in with an account that has access to the file, allow cookies, or open the file in a new tab.