Millions of Google Docs users.
Now they're your users too.
Add-ons run inside Google Sheets, Docs, and Forms, but they're built by developers like you.
Our new platform lets you add menu items and sidebars, edit files programmatically,
and tie into over a dozen Google services without even spinning up a server.
This guide will show you everything you need to publish your first add-on to our store for millions to discover.
NOTE: Add-ons are currently in developer preview. Although the features necessary to build add-ons are available to everyone, only approved developers can publish to the store. Please apply when your add-on is ready to launch.
See what you can make
If you're an Apps Script pro, this section will be old hat. For the rest, here's a quick synopsis.
Apps Script's built-in services offer easy-to-use APIs for 11 popular Google Apps, including Calendar, Drive, and Gmail — not to mention more than a dozen utility services to cover common scripting needs. Other Google products, like YouTube, are available as advanced services. Because Apps Script can connect to external APIs, it's simple to integrate your company's services with Google Apps.
When a user installs an add-on, Apps Script scans the code to determine which built-in or advanced Google services it uses, then prompts the user to authorize access to their data. If your add-on uses authenticated third-party APIs — including Google APIs that Apps Script doesn't natively support — we provide a callback URL and state token so that you can set up a secondary authorization flow.
Add-ons can create menu items and open dialogs or sidebars. For custom interfaces, HTML service offers client-side HTML, CSS, and JS with a few limitations: notably, our security sandbox doesn't work with many JS libraries. UI service can also create interfaces, but we discourage using it for professional add-ons.
Apps Script offers several ways to store data. The Properties service is great for simple strings, while the JDBC service allows you to connect to an external database — the best choice for robust applications.
The script editor includes a log and a debugger that are useful during development, but not once an add-on is published. To track errors that users encounter in the wild, consider writing logs to a database or appending a row to a private spreadsheet. Your add-on's Help menu also lets users submit anonymous bug reports.
Triggers let your add-on run when a user takes
an action like opening a document or responding to a Google Form. Add-ons can use
simple triggers like the special function
installable triggers like
form-submit, as well as
that execute code at a particular time or on a recurring interval, as frequently as every
hour or as infrequently as once per month. Note that installable triggers behave a little
differently in add-ons than in the rest of Apps Script (for one thing, no pesky "Summary of
failures" emails!), so be sure to
read the documentation.
To create an add-on, you start out by writing a script that is bound to a Google Sheets, Docs, or Forms file. (Make sure you opt in to the new version of Google Sheets, since add-ons aren't supported in the old version.) During early development, you run the script directly from that file, as shown in the quickstart. Next, make sure you understand the intricacies of the add-on authorization lifecycle. Once everything works, apply to publish to the store. After that, Google Apps users worldwide — or, if you prefer, just users within your domain — will be able to use your add-on in their own documents.
But keep the restrictions in mind
Because add-ons are brand new, there are a few things you can't do, or at least can't do easily:
✖ Change features in Google Apps
The add-ons framework is designed to enhance Google Sheets, Docs, and Forms — not to add limits. Consequently, you can't alter existing features or successfully lock down the Google Apps sharing model.
✖ Detect most user events
Except for the triggers described above, Apps Script can't tell what a user does outside the add-on itself. For example, you can't detect when the user clicks on the toolbar. It is possible to poll for changes in a file's contents from a sidebar's client-side code, although you'll always have a slight delay. That technique can also alert your script to changes in the user's selected cells (in Sheets) and cursor or selection (in Docs).
✖ Rely on server-side libraries
Brand it as your own
For the best user experience, make sure your interfaces adhere to the add-ons UI guidelines. Also, it's easy to create buttons and other elements that match the rest of Google Apps: just use our CSS package in HTML service.
Most add-ons include a logo or other images. These assets aren't packaged with the add-on; instead, your user interfaces reference them just like any other web page would. You can host assets on your own web server or on Google Drive.
Teach Sheets, Docs, and Forms to dance
Apps Script includes special APIs to let you programmatically create, read, and edit Google
To build most add-ons, you'll need to be familiar with at least one of these services.
The Spreadsheet service treats Google Sheets as a grid, operating with two-dimensional arrays.
The Document service interface for Google Docs is similar to the XML document-object model.
Publish or perish (we recommend publish)
Once your add-on is a working prototype, apply to publish to the store. If approved, we'll give you access to a test environment and expert advice on any aspects you might be having trouble with. (When add-ons graduate from the developer preview phase, anyone will be able to publish within just a few minutes.) See you in the store!