◉GEMINI LABJP
●CHANGELOG — No new Gemini API changelog entries since 11/19; the stable CLI is still v0.70.0●2.5 ROUTE — From 12/1, gemini-2.5-pro reroutes to 3.8 Flash and 2.5-flash to 3.5 Flash-Lite. 8 days left●SPEND CAP — Developers are asking for a hard spend limit on the API. Set budget alerts and decide how you would pause a key●CARBON — Gemini 4 Carbon launch pricing ends 11/30, 7 days left●OMNI 1.2 — On 12/3, gemini-omni-1.1-flash switches to 1.2 automatically●/SHELLS — /shells still appears in the docs but was removed. If a command fails, check whether it still exists●CHANGELOG — No new Gemini API changelog entries since 11/19; the stable CLI is still v0.70.0●2.5 ROUTE — From 12/1, gemini-2.5-pro reroutes to 3.8 Flash and 2.5-flash to 3.5 Flash-Lite. 8 days left●SPEND CAP — Developers are asking for a hard spend limit on the API. Set budget alerts and decide how you would pause a key●CARBON — Gemini 4 Carbon launch pricing ends 11/30, 7 days left●OMNI 1.2 — On 12/3, gemini-omni-1.1-flash switches to 1.2 automatically●/SHELLS — /shells still appears in the docs but was removed. If a command fails, check whether it still exists
Articles/Workspace
◧ Workspace/2026-03-29Advanced

Gemini × Google Workspace Add-ons Development Guide — From Building Custom AI Side Panels to Marketplace Launch

A comprehensive guide to building custom AI side panels with Google Workspace Add-ons and Gemini API — from implementation to Marketplace publication and monetization.

gemini121workspace11add-onsapps-script10marketplaceside-panelmonetization21api12

✦ Premium Article

Setup and context — Why Workspace Add-ons × Gemini?

For organizations that rely on Google Workspace daily, having AI assistance available directly from the side panel in Docs, Sheets, or Gmail represents a massive productivity boost. As of 2026, the Google Workspace Add-ons SDK supports rich UI components through Card Service v2, and when combined with the Gemini API, you can build context-aware intelligent assistants right in the side panel.

This article walks you through the complete journey — from the foundational architecture of Google Workspace Add-ons to building a Gemini API-powered AI side panel, designing OAuth scopes, navigating the security review process, and finally publishing and monetizing your add-on on the Google Workspace Marketplace. We provide production-ready code throughout, so by the time you finish reading, you should be ready to publish your own add-on.

This article assumes familiarity with Apps Script basics and a working knowledge of the Gemini API. For building cross-product workflows with Apps Script, check out "[Building Cross-Product AI Workflows with Gemini API and Apps Script]((/articles/gemini-workspace/gemini-apps-script-cross-product-ai-workflow)."

Understanding Workspace Add-ons Architecture

Google Workspace Add-ons use Apps Script or HTTP endpoints as the backend to display custom UI in the side panel of Google Workspace applications (Gmail, Docs, Sheets, Slides, Calendar).

Host Apps and Triggers

Add-ons define trigger functions for each "host app." For example, when a user opens an email in Gmail or a document in Docs, the corresponding trigger function fires and generates the Card UI for the side panel.

  • Homepage Trigger: The home screen displayed when the user clicks the add-on icon
  • Contextual Trigger: Screens that auto-display based on context (opening an email, selecting a document, etc.)
  • Action Callback: Functions invoked on button clicks or form submissions

Card Service v2 UI Components

Card Service v2 provides these key components:

  • CardBuilder: Root container for cards
  • CardSection: Section dividers with headers
  • TextParagraph / DecoratedText: Text display
  • TextInput / SelectionInput: User input forms
  • ButtonSet / TextButton / ImageButton: Action buttons
  • Grid / GridItem: Grid layouts
  • Divider: Section separators

By combining these components, you can build chat-like interfaces, form input screens, analytics dashboards, and more — all within the side panel.

Manifest File (appsscript.json) Structure

{
  "timeZone": "America/New_York",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "oauthScopes": [
    "https://www.googleapis.com/auth/gmail.readonly",
    "https://www.googleapis.com/auth/documents.currentonly",
    "https://www.googleapis.com/auth/spreadsheets.currentonly",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/userinfo.email"
  ],
  "addOns": {
    "common": {
      "name": "Gemini AI Assistant",
      "logoUrl": "https://example.com/logo.png",
      "layoutProperties": {
        "primaryColor": "#4285F4"
      },
      "homepageTrigger": {
        "runFunction": "onHomepage"
      }
    },
    "gmail": {
      "contextualTriggers": [{
        "unconditional": {},
        "onTriggerFunction": "onGmailMessage"
      }]
    },
    "docs": {
      "homepageTrigger": {
        "runFunction": "onDocsHomepage"
      }
    },
    "sheets": {
      "homepageTrigger": {
        "runFunction": "onSheetsHomepage"
      }
    }
  }
}

The oauthScopes design directly affects whether your add-on passes the security review. Always follow the principle of least privilege — when a currentonly scope is available, prefer it over the full-access equivalent (e.g., documents.currentonly instead of documents).

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Master implementation patterns for integrating the Workspace Add-ons SDK with Gemini API
✦Understand the full process from OAuth scope design to security review and Marketplace submission
✦Gain practical know-how for building subscription billing models and optimizing revenue
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◧ Workspace2026-10-18
When the Gemini app can't reach Gmail or Drive: five places to check, starting with what you can fix yourself
When the Gemini app won't connect to Gmail, Drive or Calendar, or connects and still comes back empty, check your prompt, account, activity setting, smart features and admin settings, in that order.
◧ Workspace2026-05-27
Replying to 11 Languages of Google Play Reviews With Gemini Without Sounding Like a Bot
After two major Android updates, I had to clear a backlog of unanswered Google Play reviews in Japanese, English, Traditional Chinese, Korean, Thai, Italian, Russian, Persian, Ukrainian, and Polish. This is the operations design I settled on for using Gemini as a translation and vocabulary partner without losing the human temperature.
◧ Workspace2026-07-16
I Put =GEMINI() in 420 Cells. The Calls Kept Coming on Days I Never Opened the Sheet
A custom function calling Gemini from Sheets looks best the moment it starts working, and it does not grow from there. Here is what the 30-second ceiling, uncontrolled recalculation, and read-only cells actually cost, measured, plus the code to move to a write-back design.