All Projects β†’ dhayab β†’ gmail-addon-boilerplate

dhayab / gmail-addon-boilerplate

Licence: MIT License
A TypeScript-based Gmail add-on Boilerplate

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to gmail-addon-boilerplate

odoc
Next.js based Static πŸ““ Documentation Site Generator
Stars: ✭ 17 (-29.17%)
Mutual labels:  starter-kit
flask-app-blueprint
Flask App Blueprint / Boilerplate including user registration/login, admin only section, CRUD on database, and more. Based on Python, Flask, PostgreSQL, et al. deployed on Heroku. The #1 starter project.
Stars: ✭ 144 (+500%)
Mutual labels:  starter-kit
ReactNativeStarterKits
Agiletech React Native Starter Kits
Stars: ✭ 21 (-12.5%)
Mutual labels:  starter-kit
simple-react-starter
Simple ReactJS starter with an opinionated folder structure.
Stars: ✭ 15 (-37.5%)
Mutual labels:  starter-kit
AdminLTE-Starter-Kit
AdminLTE Starter Kit for ASP.NET Core
Stars: ✭ 91 (+279.17%)
Mutual labels:  starter-kit
fly-kit-preact
A starter kit for building offline / SPA / PWA apps with Preact
Stars: ✭ 28 (+16.67%)
Mutual labels:  starter-kit
modular-starter-kit
The starter kit with entire modular approach to help remove boilerplate code in developing
Stars: ✭ 14 (-41.67%)
Mutual labels:  starter-kit
nextjs-starter-kit
NextJS Starter Kit with Testing Frameworks and CI/CD
Stars: ✭ 30 (+25%)
Mutual labels:  starter-kit
svelte-starter-kit
Svelte with brilliant bells and useful whistles
Stars: ✭ 384 (+1500%)
Mutual labels:  starter-kit
tailwindcss-postcss-browsersync-boilerplate
Tailwind CSS + PostCSS + BrowserSync boilerplate
Stars: ✭ 28 (+16.67%)
Mutual labels:  starter-kit
padstone
Padstone is a Craft CMS starter kit with a curated configuration, Boilerplate templates, and handpicked plugins.
Stars: ✭ 18 (-25%)
Mutual labels:  starter-kit
relay-starter-kit
πŸ’₯ Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, Material UI.
Stars: ✭ 3,513 (+14537.5%)
Mutual labels:  starter-kit
bem-express
BEM project-stub with BEMTREE and express
Stars: ✭ 45 (+87.5%)
Mutual labels:  starter-kit
Minimal-React
Minimal React + Redux starter kit for experiments.
Stars: ✭ 43 (+79.17%)
Mutual labels:  starter-kit
modernization-cookbook-template
Starter Cookbook for Application Modernization and Replatforming Engagements
Stars: ✭ 14 (-41.67%)
Mutual labels:  starter-kit
coconat
πŸ₯ StarterKit Builder for rocket-speed App creation on πŸš€ React 17 + πŸ“™ Redux 4 + 🚠 Router 5 + πŸ“ͺ Webpack 5 + 🎳 Babel 7 + πŸ“œ TypeScript 4 + πŸš” Linters 23 + πŸ”₯ HMR 3
Stars: ✭ 95 (+295.83%)
Mutual labels:  starter-kit
fire-starter
Starter kit for the fireloop.io platform
Stars: ✭ 16 (-33.33%)
Mutual labels:  starter-kit
dart electron starter kit
Boilerplate project for building Electron apps with Dart.
Stars: ✭ 31 (+29.17%)
Mutual labels:  starter-kit
go8
Go + Postgres + Chi Router + sqlx + ent + unit testing Starter Kit for API Development
Stars: ✭ 103 (+329.17%)
Mutual labels:  starter-kit
smix-eleventy-starter
A standards-respecting starter kit for Eleventy. Go Indie.
Stars: ✭ 108 (+350%)
Mutual labels:  starter-kit

Gmail Add-on Boilerplate

This repository holds the code of a starting point for creating Gmail add-ons, on the Google Apps Script platform.

Installation

$ git clone https://github.com/dhayab/gmail-addon-boilerplate.git my-gmail-addon
$ cd my-gmail-addon
$ rm -rf .git
$ npm install

Don't forget to change the package name and other values in package.json.

Development

The starting point is the src/ directory. It contains TypeScript source files for the add-on, and a manifest file called appsscript.json.

There are a few subtleties to keep in mind when writing code for use in Google Apps Script.

  1. Export callback functions: Functions that will be called by Google Apps Script should be exported in your source code, to prevent the TypeScript compiler from failing on build. The bundle step will remove the export { /* ... */ } statement.
  2. Do not reuse function names: After the build phase, all files are bundled into a single addon.js file. So don't export functions that have the same name in different files.

To build the project, just type this in your terminal:

$ npm run build

You can also watch for errors during the development by typing npm run watch.

Deployment

This project uses the google-apps-script CLI (also named gas) to allow files to be synced to an existing project or to create a new Google Apps Script project. The complete documentation can be found here.

1. Authentication

First of all, you need to authenticate yourself to gas by typing the following:

$ npm run gas -- auth

Then, follow the instructions on screen.

2. Project association

You must associate your code with a Google Apps Script project. In order to do that, you can either create a new project or retrieve a list of your existing projects. Then you'll need to create the link between your code and the project.

# Create a new project
$ npm run gas -- create my-gmail-addon
...
Creating 'my-gmail-addon' in your Google Drive... [βœ”]
[PROJECT_HASH] my-gmail-addon

# Or list your existing projects
$ npm run gas -- list
...
[PROJECT_HASH] Foo
[PROJECT_HASH] my-gmail-addon
[PROJECT_HASH] Random Project

# Link to your code (you can also specify the hash instead of the project name)
$ npm run gas -- link my-gmail-addon
...
Linking 'my-gmail-addon' to this folder... [βœ”]

3. Pushing code changes

When you're ready to send your code to Google Apps Script, just type this command in your terminal:

$ npm run upload

You code is now available in the associated Google Apps Script project!

Add-on execution

To view your Gmail add-on in action, you have to install it in the Gmail settings.

First of all, retrieve the Deployment ID of your project. Go to your script, either manually by opening it from Google Drive, or from the terminal, with this command:

$ npm run gas -- open

Then go to Publish > Deploy from manifest… and click on Get ID.

Now, open your Gmail settings (click here) and enable the Developer mode by clicking on the checkbox, and paste the Deployment ID in the text input that has appeared.

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].